Subject Re: [Firebird-Java] Multiple connections to embedded Firebird
Author Helen Borrie
At 11:51 AM 23/12/2004 -0600, you wrote:


>My understanding is that embedded Firebird does not support multiple
>concurrent connections.

Well, yes, it does. The embedded server is just a Superserver. Like the
"full" server, it opens the database file when the first attachment is made
and locks the file exclusively. That means no other server can access it.
It doesn't mean you can't make multiple connections to it.

Meanwhile, if you have a group of applications in the embedded server's app
directory, they can make connections to the server.

>However, I am able to open multiple connections
>via Jaybird. I'm a bit suspect of these and suspect there will be
>problems (deadlocks?, data corruption?)

No more than if the "full" server was serving the database. It's the same
server.

>if I use them non-serially (i.e. from different threads).

The current "local" connection protocol (IPServer, the one that you must
use with embedded) isn't thread-safe. Let the server take care of the
threading on its side, by making a distinct connection for each operation
that you would normally thread off from a TCP/IP or NP connection if you
were running multi-user.

Embedded in Firebird 2 will use a different local protocol (XNET). I
haven't tried it yet but I understand it is thread-safe.


>Is this the case? If so, should Jaybird throw an exception when multiple
>connections to the same database file are opened?

No. On the other hand, you're likely get AVs if you try to multi-thread a
connection.

Helen