| Author |
Connection Pooling
|
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
|
|
I have a query regarding connection pooling. Am using a data source for the EJB interface. And it uses 50 connections minimum. While the running it reuses the connection (as per pooling technique) but in every transaction some data’s were updated on the database. How come the new data will reflect on the interface application with old connection object.
Whether we need to refresh the database everytime before the transaction starts
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26184
|
|
Meet,
When you close the connection, it commits (updates the database) and returns to the pool for another transaction. There isn't overlap between multiple requests. Everytime you request a connection from the pool, you start out clean.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
|
|
So by default when I close the connection it commits the database. No need to call commit from java side
|
 |
Balu Sadhasivam
Ranch Hand
Joined: Jan 01, 2009
Posts: 874
|
|
Its uncharacteristic behaviour of the Driver which we cannot rely on. However I find Its true that it commits any un-rollbacked transactions when you close the connection.
|
 |
 |
|
|
subject: Connection Pooling
|
|
|