If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SQLException: java.sql.Connection.close() requested while a transaction is in progres

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-02-04, 14:28
jeeva jeeva is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
SQLException: java.sql.Connection.close() requested while a transaction is in progres

I am trying to query (a SELECT) a dab3 database with JAVA JDBC API.

The select query works fine, but when i try to close the JDBC Connection that I opened processing Query, I get the above titled error.

The full stack trace is below:

com.ibm.db2.jcc.b.SQLException: java.sql.Connection.close() requested while a transaction is in progress on the connection.The transaction remains active, and the connection cannot be closed.
at com.ibm.db2.jcc.b.l.j(l.java:556)
at com.ibm.db2.jcc.b.l.close(l.java:540)

Any one got an idea how to resolve this?
Thanks in advance,
Jeeva
Reply With Quote
  #2 (permalink)  
Old 01-02-04, 14:35
jeeva jeeva is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
Wink Re: SQLException: java.sql.Connection.close() requested while a transaction is in progres

Sorry, for the typo - i meant db2 not db3!
Reply With Quote
  #3 (permalink)  
Old 01-08-04, 05:50
kristjang kristjang is offline
Registered User
 
Join Date: Jun 2003
Posts: 2
Re: SQLException: java.sql.Connection.close() requested while a transaction is in progres

Got the same problem as you. I am using the type 2 com.ibm.db2.jcc.DB2Driver driver.

Any luck?
Reply With Quote
  #4 (permalink)  
Old 01-08-04, 10:02
jeeva jeeva is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
Re: SQLException: java.sql.Connection.close() requested while a transaction is in progres

Yes, Got a solution - Kinda workaround.

Before closing the connection, If I do a COMMIT, then connection closes normally.

But Not sure Why do you have do a COMMIT for a SELECT is something unanswerd.

The samething works alright without a COMMIt In ORACLE.

Weird!

-Jeeva
Reply With Quote
  #5 (permalink)  
Old 01-08-04, 10:15
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: SQLException: java.sql.Connection.close() requested while a transaction is in pro

Quote:
Originally posted by jeeva
Yes, Got a solution - Kinda workaround.

Before closing the connection, If I do a COMMIT, then connection closes normally.

But Not sure Why do you have do a COMMIT for a SELECT is something unanswerd.

The samething works alright without a COMMIt In ORACLE.

Weird!

-Jeeva
normally you would need to close ResultSet and Statement before attempting to close the Connection... I think this is where your problem lies.
Reply With Quote
  #6 (permalink)  
Old 01-08-04, 10:27
jeeva jeeva is offline
Registered User
 
Join Date: Jan 2004
Posts: 10
Re: SQLException: java.sql.Connection.close() requested while a transaction is in pro

Yeah, I verified that we do Close the ResultSet. We are also closing Statement.

Finally Close the COnnection - before which with out a COMMIT - it causes the error!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On