You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Mark P Ashworth <in...@connext.co.za> on 2007/10/01 12:27:04 UTC

Maximum connections to embedded database

Good Day,

I would like to know the maximum number of connections that a Embedded Derby
database can maintain? 

Regards,
Mark P Ashworth
-- 
View this message in context: http://www.nabble.com/Maximum-connections-to-embedded-database-tf4547454.html#a12976696
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Maximum connections to embedded database

Posted by Dy...@Sun.COM.
Mark P Ashworth <in...@connext.co.za> writes:

> Good Day,
>
> I would like to know the maximum number of connections that a Embedded Derby
> database can maintain? 

This is a bit tricky to answer, since the answer can be either
unlimited or one, depending on what you actually mean by
"connection". 

Embedded Derby can return an unlimited (limited by
system resources of course) java.sql.Connection objects that can
access the database simultaneously, but all these connections need to
exist within the same jvm.

A database can only be accessed by a single jvm at a time. So if, by
"connection" you mean another jvm accessing a database that's already
opened, the answer is only one such "connection" is allowed.

Note that this means that you cannot use ij to inspect your database
while your embedded application is running. There are two ways to get
around this:

A) Shut down the database from the embedded application before
accessing the database in ij, or 

B) Start your embedded application as an embedded server (see the
documentation). Your app will continue to access the database in
embedded mode, but other clients (like ij) can connect to your app as
if it was a server (it needs to use the ClientDriver and a network
URL to do this). 

HTH

-- 
dt