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

Reply via email to