Subject | Re: [Firebird-Java] Multiple connections to embedded Firebird |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-12-24T09:03:50Z |
Hi Garrett,
multiple processes (i.e. JVMs), but within one JVM you can open as many
connections as you like. See release notes.
on connection object, embedded server is thread-safe) and Linux
(synchronizes on static mutex, embedded server is not thread-safe, release
notes contain more information).
Deadlocks are possible, but this is always possible when you have concurrent
transactions and has nothing to do with embedded server.
Data corruption does not happen because of using connection from multiple
connections on Windows. And you cannot open the same database from multiple
processes (i.e. JVMs) since file is opened in exclusive mode.
On Linux you have to take care that only one processes (i.e. JVMs) accesses
the same database, since the database file is accessed in shared mode, and
if no lock manager is running (and I'm not sure if libfbembed.so uses it)
you will corrupt the database. But as long as you stay in one JVM everything
is ok.
Roman
> My understanding is that embedded Firebird does not support multipleIt is wrong understanding. You cannot connect to the same database file from
> concurrent connections.
multiple processes (i.e. JVMs), but within one JVM you can open as many
connections as you like. See release notes.
> However, I am able to open multiple connections via Jaybird. I'm a bitDriver takes care of this on Windows (by doing nothing except syncronizing
> suspect of these and suspect there will be problems (deadlocks?, data
> corruption?) if I use them non-serially (i.e. from different threads).
on connection object, embedded server is thread-safe) and Linux
(synchronizes on static mutex, embedded server is not thread-safe, release
notes contain more information).
Deadlocks are possible, but this is always possible when you have concurrent
transactions and has nothing to do with embedded server.
Data corruption does not happen because of using connection from multiple
connections on Windows. And you cannot open the same database from multiple
processes (i.e. JVMs) since file is opened in exclusive mode.
On Linux you have to take care that only one processes (i.e. JVMs) accesses
the same database, since the database file is accessed in shared mode, and
if no lock manager is running (and I'm not sure if libfbembed.so uses it)
you will corrupt the database. But as long as you stay in one JVM everything
is ok.
> Is this the case? If so, should Jaybird throw an exception whenNo. Everything is ok.
> multiple connections to the same database file are opened?
Roman