Subject Re: Type2 local-mode threadsafe ?
Author Roman Rokytskyy
Hi,

> I'm using Firebird1.5, Jaybird RC2 with Java 1.4.2_04, Windows XP
> and want to test type2 driver in local-mode. This means application
> and Firebird-Server on the same host, right ?

Right.

> I must put jaybird.dll(why is the dll not included in the
> RC-download of jaybird ?)

Because RC package of JayBird is platform-independend, shared
libraries - platform dependend. This would break packaging. We would
have to either release JayBird for Linux, JayBird for Windows, etc. or
to release it the way it is now. I have chosen latter.

> and gds32.dll (from Firebird/bin dir) in my working directory to get
> it working.

Not neccessarily, gds32.dll or fbclient.dll should be already in
C:\WINNT\SYSTEM32, jaybird.dll should find them.

> (i tested it with a directory lib and setting the java.library.path,
> but this is not working. I always get
> java.lang.UnsatisfiedLinkError: no jaybird in java.library.path,
> Do i have to set the path-variable from Windows to get it working ?)

If your gds32.dll or fbclient.dll cannot be found in the
C:\WINNT\SYSTEM32, you have to ensure that their location is included
in the system PATH (path-variable from Windows). I have no problems
running JayBird in local mode having jaybird.dll in working dir and
standard installation of FB 1.5.0.

> My questions:
> Is type2 local mode thread-safe (like type4) ?

Yes. Client library requires one thread per connection at a time, this
is ensured by driver itself. See release notes.

> Can i use the jaybird build-in connection pooling with type 2 local
> mode ?

Yes, connection and prepared statement pooling is available for all
variants of JayBird. Be sure to set type correctly, it is "LOCAL",
probably not reflected in the documentation. I will update it.

> With type2 embedded-mode:
> Can i have only 1 concurrent connection, or can i have multi
> connections with the same database user (only 1 user connecting to
> the db) ?

You can have as many connections as you like. On Windows it should
work without any problems, on Linux (and other POSIX platforms) you
have to ensure that only one thread is accessing embedded library at a
time. I'm not sure if we will introduce any synchronization in the
driver, since Vulcan is going to solve this issue.

Best regards,
Roman Rokytskyy