commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vernon Smith" <>
Subject Re: [DBCP] Can DBCP be used to solve this XA issue?
Date Mon, 08 Dec 2003 21:58:26 GMT
Hi, John,

It seems that I need to provide more details of the scenario. Before executing the first insertion,
the connection obtained from the pool is set auto-commit to false, while the default auto-commit
setting is on. After the execution, the connection can't be committed and must be returned
into the pool. Several issues raise at this point.  Unless the pool size is one and only one
source of connection pool request, it is not guarantee that the same user will get the same
connection from the pool in the next  insertion operation. That will mess up the rest of all

I could modify the version of BD connection pool so that the special connection can be stored
and retrieved separatedly in the pool. Two issues with this modification: how to recycle the
connection if the sequence of insertion operations is abort (time stamp approach?); how to
recreate the connection after the backend DB is down. 
I think the PoolablePreparedStatement in DBCP might solve this problem. 

Any advise?

>> Hi,
>> Here is a situation:
>> During a user registration, data is inserted into a sequence of tables. 
>> Those insertion queries are submitted at different time during the 
>> registration. To maintain the data integrity, the data shall be either 
>> all written or none of them written. Other than this scenario, the rest 
>> of queries in the application work fine with the auto-commit setting. 
>> The current version of BD connection pool in place is unable to handle 
>> this issue without JTA. I have browsed over the DBCP API. It seems to me 
>> the DBCP might be able to the job. I have done a thorough search in the 
>> Jakarta site and using Google, unable to find more detailed 
>> document/examples on the subject. Can someone give me a help?
>DBCP is for connection pooling, which is a separate issue from transaction 
>Check the documentation of you JDBC driver for transaction support.
>A function like Connection.setAutoCommit(boolean) should be supported by 
>the driver.
>If not, switch to an other database driver like MySQL, Postgresql or McKoi 
>that all support transactions.
>With Connection.setAutoCommit(false) you start a transaction which you 
>have to end with either a commit() or a rollback().
>John Zoetebier
>Web site:

Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!

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

View raw message