Board index » delphi » "Directory is busy"

"Directory is busy"

I am building a proxy server with my own socket interface to clients in
my main thread and creating a DataModule for each thread to talk to the
same Oracle 7 remote server for a simple lookup through an existing
The DataModule just has Session1, Database1, StoredProc1 components.

Below is the DataModule.Method I call at the start of each Thread's
ExecuteMethod to start up.
It works for one thread but if I try to start two the second complains
with "Directory is busy" - I think it arises when the
Database1.connected is set to true.
As you can see I have already tried a different PrivateDir, and
DatabaseName for each thread.
NetDir is C:\ for all.
I am using the same AliasName too - should I have a different Alias for
each thread too.

procedure TDataModule1.StartRunning(thno:integer; var ok:boolean);


  Database1.DatabaseName:= database_alias+'T'+IntToStr(thno);
  if not Database1.connected then Database1.connected:=true;
  StoredProc1.DatabaseName:= database_alias+'T'+IntToStr(thno);
  StoredProc1.StoredProcName:= storedproc_name;


Re:"Directory is busy"

Database1.SessionName is pointing at Session1?


Re:"Directory is busy"

Thanks for reply, sorry for being thick, but I still don't understand,
Ch16-17 of Delphi 4 Developers Guide suggests the technique I am trying
to use where:
Each thread has created its own copy of DataModule1 hence of the
Session1 component and with AutoSessionName=true this makes session1_1,
_2 etc. for each thread.
So why aren't they different sessions?
WmBurke(TeamB) wrote:

> Database1.SessionName is pointing at Session1?

> =Bill=

Re:"Directory is busy"

>>So why aren't they different sessions?

They should be different sessions.  

Have you verified that all of the TDatabase / TDataset objects within the thread are pointing at the correct session...?


Other Threads