Could someone please tell me the correct way to return a connection to a connection pool. I have seen these two so far: 1. conn.close() // releases the connection object's database 2. conn.commit()// makes database changes permanent and releases the lock
The reason i'm asking is that i always use the first option but i saw second option used in some other application. Could someone tell me which is better and why? Thanks.
Jay [ April 20, 2006: Message edited by: jay donald ]
I've never seen that a commit() releases the connection in any pool I've ever used. It makes no sense - after a commit you could still want to do other things with the Connection. After a close() you should never do anything with the Connection.
Just my <small amount of your local currency> worth.
<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.