db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: Does using DerbyDB require synchronization?
Date Tue, 09 Sep 2008 14:05:44 GMT
> separate connections for each thread as I've noticed establishing connection
> in Derby takes a while,

Another way to address this is to use connection pooling. Use a separate
connection for each thread, but when a unit of work is complete, commit
the connection's transaction, then return it to the pool, and re-acquire
the connection again from the pool later when you are ready to perform
the next unit of work.

In my application, I have many (hundreds) of threads, each with their
own connection to the database, but I very rarely have more than 10-12
active connections because the connections are pooled and re-used among
the various threads.

thanks,

bryan


Mime
View raw message