commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <>
Subject Re: [DBCP] Please let us start to improve the connection pool
Date Mon, 24 Mar 2003 17:28:16 GMT
"There are several circumstances where two different pieces of code can be
inadvertently sharing the same connection."

Connection pool user is responsable for this. User can store connection in
ThreadLocal or
 implement something like this:

class MySafeConnection implements InvokationHandler{

  Connection connection;
  WeakReference owner;

   MySafeConnection(Connection connection){
     this.connection = connection;
     owner = new WeakReference( Thread.currentThread() );

 Object invoke(Object obj, Method method, Object args[] ) throw Throwable{

    if(  owner.get() == Thread.currentThread()   ){
        method.invoke( connection, args );
        throw new IllegalStateExeption();


 static Connection decorate(Connection connection){

                                    new Class[] {Connection.class}, new



It is trivial, isn't it ?
I do not think stuff like this must be included in to pool distribution, but
it can be in documentation.

----- Original Message -----
From: "Mario Ivankovits" <>
To: "Jakarta Commons Developers List" <>
Sent: Monday, March 24, 2003 6:34 PM
Subject: [DBCP] Please let us start to improve the connection pool

Hello !

There are some bug or RFE in DBCP which sould be fixed.
Some people (including me) have already posted in this list, but it seems
there is no DBCP developer anymore or he/she is very busy.

Could one of the DBCP people please comment on how and when development in
DBCP could advance.

I would like to help in improving it (i have already posted a patch for, but if there is no
one in this list who is willing to discuss, it is hard to do it right.

Hope to hear from one of you  ...


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message