db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: I need some advice to choose database for an upcomming job
Date Mon, 07 Nov 2005 11:56:53 GMT
Oyvind.Bakksjo@Sun.COM wrote:

> Note A: You may want to create and use more than one connection to
> increase performance if you have many simultaneous requests.

I would not recommend a single connection for any simultaneous requests.

> Note B: If you're running with autocommit OFF, you should definately not
> use the same connection object in multiple simultaneous requests (either
> use synchronization or create multiple connections).

This is true even with automcommit on. Multiple threads using the same
connection with ResultSets will mess with each other, as per the JDBC
sprc. An executeQuery by one thread will close any ResultSet any other
thread is processing.

If you are running Derby embedded then the cost of creating a connection
per request will be much lower than traditional client server databases,
and most likely will be a small fraction of the cost of the query or update.

If you are concerned about the cost of multiple connections, then you
can use connection pooling.

Dan.


Mime
View raw message