On Sat, 15 Nov 2003 18:20:13 +0530, Antony Paul <[EMAIL PROTECTED]> wrote:

Hello,
I am using DBCP available with TOmcat 4.1.27. I use a static
synchronised method to get the connection from pool. In DBCP configuration
no parameter is setting the transaction status(setAutoCommit()). I want to
know what is happening when getting a connection from pool. Do I have to
call rollback() before giving the connection to client or do DBCP itself
does this. I feel that calling rollback() causes a performance penalty.

Once the DBCP connection pool is setup you can use a connection like you normally do.
There is absolutely no need to use a static method to get a connection from the pool.
The connection pooling is completely transparent from a client point of view.
Suppose your pool is called "example".
Get you connection from pool with:
conn = DriverManager.getConnection("jdbc:apache:commons:dbcp:example");


Send connection back to pool with:
conn.close()

All other connection methods work as usual:
conn.conn.setAutoCommit(true);
if (OK) {
        conn.commit();
} else {
        conn.rollback();
}

--
John Zoetebier
Web site: http://www.transparent.co.nz

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to