Hello Kathy.
Kathey wrote:
In Derby when you close a connection, the close will fail if there is an
active transaction, so the rollback is needed to allow the connection to
close properly.
Yes, there is a history which is that the rollback was not needed on
connection close in a previous incarnation of the Cloudscape product.
The rollback had to be added to ensure the connections were closed
properly.
Can I know about the history ?
I have found next implementation in
org.apache.derby.impl.jdbc.EmbedConnection#close().
/* Throw error to match DB2/JDBC if a tran is pending in non-autocommit
mode */
if (!autoCommit && !transactionIsIdle()) {
throw newSQLException(SQLState.LANG_INVALID_TRANSACTION_STATE);
}
Are there any reason around compatibility with DB2 ?
Best regards.
/*
Tomohito Nakayama
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Naka
http://www5.ocn.ne.jp/~tomohito/TopPage.html
*/
----- Original Message -----
From: "Kathey Marsden" <[EMAIL PROTECTED]>
To: "Derby Development" <[email protected]>
Sent: Wednesday, June 29, 2005 2:34 AM
Subject: Re: [jira] Updated: (DERBY-397) Make it sure for the connection to
be closed in drda.Database#close() even if Exception happens in
conn.rollback().
TomohitoNakayama wrote:
Hello.
I annotated org.apache.derby.impl.drda.Database.java and
found call of conn.rollback() exists from "Initial code import"...
37083 coar protected void close() throws SQLException
37083 coar {
37083 coar
37083 coar try {
37083 coar if (stmtTable != null)
37083 coar {
37083 coar for (Enumeration e = stmtTable.elements() ;
e.hasMoreElements() ;)
37083 coar {
37083 coar ((DRDAStatement) e.nextElement()).close();
37083 coar }
37083 coar
37083 coar }
37083 coar if (defaultStatement != null)
37083 coar defaultStatement.close();
37083 coar if ((conn != null) && !conn.isClosed())
37083 coar {
37083 coar conn.rollback();
37083 coar conn.close();
37083 coar }
37083 coar }
37083 coar finally {
37083 coar conn = null;
37083 coar currentStatement = null;
37083 coar defaultStatement = null;
37083 coar stmtTable=null;
37083 coar }
37083 coar }
Hmm....
This calling conn.rollback() seems to have history ....
In Derby when you close a connection, the close will fail if there is an
active transaction, so the rollback is needed to allow the connection to
close properly.
Yes, there is a history which is that the rollback was not needed on
connection close in a previous incarnation of the Cloudscape product.
The rollback had to be added to ensure the connections were closed
properly.
Kathey
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.5/32 - Release Date: 2005/06/27
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.6/33 - Release Date: 2005/06/28