Subject Re: Multi-threaded simultaneous isc_attach_database calls create problems
Author ericcamelot777
--- In, Paul Reeves <paul@f...> wrote:
> On Wednesday 06 April 2005 23:59, Eric wrote:
> > We have Firebird 1.5.2 SuperServer and our client application creates
> > new threads for each database connection. When two connection
> > occur simultaneously in our multi-threaded environment, a call to
> > isc_attach_database is made, and then another call to
> > isc_attach_database occurs before the first call has returned, and
> > neither call returns.
> >
> What do you mean by 'neither call returns'? I've seen the server
> when multiple threads try to access it, but it always returns.

I've bracketed the call to the function with debug code which writes
to a log file. Essentially it looks like this:

WriteLog('Begin of isc_attach_database');
Result := isc_attach_database(StatusVector, DBNameLength, DBName,
DBHandle, ParmBufferLength, ParmBuffer);
WriteLog('End of isc_attach_database');

With multi-threaded simultaneous calls, the log file shows two begins,
and zero ends. Without the simultaneous calls, the function returns,
and the code works as expected.