Subject Re: Multiple threads with one connection each
Author nitaligavino <Dan.Crea@apropos.com>
Hi Jonas:

I have not worked with the ODBC driver but I have worked directly
with the CLI, e.g., the API that the ODBC drive eventually calls
into. Anyway, as Alexander mentioned, item a, it's important that
the connection to the database is made as a TCP/IP connection when
working with multiple threads. If the connection is made locally,
like, "c:\database.gdb" attempting to connect and use multiple
threads will fail. The connection string needs to set the engine in
super server mode, e.g., "localhost:/c:/database.gdb", which supports
multithread clients. I suspect the configuration of the ODBC drive
is the cause of your lock.

Here is a snip-it from source forge:
http://ofbodbc.sourceforge.net/drvinfo.html

" How does correct connection string look like?
Sample connection string:
"DRIVER={XTG Systems InterBase6 ODBC
driver};DB=myserver:c:\mypath\mydb.gdb;UID=myname;PWD=secret;CHARSET=W
IN1250;ROLE=myrole;" "

The connection sting in this example seta the engine in super server
mode, "DB=myserver:c:\mypath\mydb.gdb", by specifying the server name
before the db path.

Hope this helps!

Best regards,
Dan

--- In ib-support@yahoogroups.com, "Alexander V.Nevsky <ded@h...>"
<ded@h...> wrote:
> --- In ib-support@yahoogroups.com, "Datatal AB - Gauffin, Jonas"
> <jonas@d...> wrote:
> > Hello
> >
> > I'm writing a small test application for firebird that uses Open
> > FireBird ODBC Driver.
> > Everything works nice when I got one connection.
> > But as soon as I load up more threads, with one connection each,
> > everything stops in the execution of a sql statement (SELECT
> > GEN_ID(GEN_USER, 1) FROM RDB$DATABASE).
> >
> > I've started with a thread that do random reads and a thread that
do
> > random inserts/updates.
>
> [skip]
>
> > What can be wrong?
>
> Jonas, I don't know C, but I could'nt find in your text
> a) connection string - local connections are queued in gds32 so you
> threads will wait each other.
> b) transaction parameters - some modes produce infinitive waiting
on
> lock conflict resolution with random tests.
>
> Best regards, Alexander V.Nevsky.