This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes do i need to set setAutoCommit to true in the final block when i use both pooling and transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "do i need to set setAutoCommit to true in the final block when i use both pooling and transaction" Watch "do i need to set setAutoCommit to true in the final block when i use both pooling and transaction" New topic
Author

do i need to set setAutoCommit to true in the final block when i use both pooling and transaction

heng zhang
Greenhorn

Joined: Jul 12, 2010
Posts: 16
HI,
I use jdbc connection pooling and transaction.
i set setAutoCommit to false to use the transaction. when i return this connection to the pool. i wonder if i need to set this connection's setAutoCommit to false, which means back to its normal status?

Thanks
Heng
Ed Ward
Ranch Hand

Joined: Jan 30, 2006
Posts: 147
I think it really depends on the situation and your definition of "need". Technically it is not necessary; but it seems to me that returning it to the pool in the same state as it was when you retrieved it would be a good practice.
 
Don't get me started about those stupid light bulbs.
 
subject: do i need to set setAutoCommit to true in the final block when i use both pooling and transaction
 
Similar Threads
JDBC Oracle Persistence Builder of Visual Age
can this be solved
How to update string to Oracle Clob
Rollback in Oracle
setAutoCommit(boolean autoCommit)