Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
heng zhang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic