The Artima Developer Community
Sponsored Link

Java Answers Forum
Calling rollback on a Connection released to the pool

2 replies on 1 page. Most recent reply: Jun 28, 2003 5:03 PM by zenykx

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
The Phoenix

Posts: 6
Nickname: phoenixb
Registered: May, 2003

Calling rollback on a Connection released to the pool Posted: Jun 26, 2003 12:58 AM
Reply to this message Reply
Advertisement
Suppose i obtain a Connection from a Connection Pool (through a DataSource). I release the Connection to the pool by calling con.close(). Note that close() doesn't actually close the Connection but merely releases it to the pool. Now, what will happen if i call con.rollback() (or any other method, for that matter) on the Connection. Please respond ASAP.
Thanks in advance.


zenykx

Posts: 69
Nickname: zenykx
Registered: May, 2003

Re: Calling rollback on a Connection released to the pool Posted: Jun 28, 2003 4:58 PM
Reply to this message Reply
If you ready the API you find:
"Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled."

zenykx

Posts: 69
Nickname: zenykx
Registered: May, 2003

Re: Calling rollback on a Connection released to the pool Posted: Jun 28, 2003 5:03 PM
Reply to this message Reply
Sorry ... tired .... probably you get a SQLException ... you may look at some Connection real implementation to see exactly what happens. I checked within Sybase Connection implementation and their before trying to execute rollback checks the connection and throws an exception.

Sorry again for the 1st answer... i little tired.

Flat View: This topic has 2 replies on 1 page
Topic: How do you retrieve data from a grid (in a file) using java Previous Topic   Next Topic Topic: jtable and object data [][]

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use