Subject | Re: [Firebird-Java] DataExpress problem |
---|---|
Author | |
Post date | 2016-10-17T15:33:06Z |
Hi Mark,
I actually deleted my own message because I found a workaround and did not want to trouble you but you was fast too fast answering :)
The link to JDBC-435 seems to be bad.
Its pretty easy making a simple connection pooling with mechanism so that a connection is only used by one thread a time.
But my application is a desktop application with a single user. I'm sure that in a server environment a real pool mechanism us needed, such as c3p0.
BlockingQueue<Database> pool = new ArrayBlockingQueue<Database>(size);
//Borrow connection from any thread
Database db = pool.take();
try{
//Do you stuff with db
} finally {
//Return db to pool.
pool.offer(db);
}