Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting connection Attribute

 
Jotty Tharakan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are taking conection from IAS connection pool for our work.My doubt is this.
If Bean A takes a connection from pool and set the attribute of the connectio object to
con.setAutocommit(false).After commit he is returning the conection to pool.
Now suppose Bean B gets the same connection from the pool and he is expecting the default attribute from the connection object.So he is not committing explicitly.
I suspect that since bean A sets the attribute to Autocommit(false) the updation done by bean B will not be committed unless bean B explicitly commit it.
Can anyone comment on this .Is my conclusion correct or not ?
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The connection should return to it's default state once it has been returned to the pool.
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you do this for a test you can find out:
- configure the pool for a certain number of connections
- get that many connections from the pool all at once
- set autocommit on them all
- close them/release them all
- get another connection, which you will know you definitely set autocommit on
- call getAutoCommit()

[ June 16, 2002: Message edited by: Adam Hardy ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic