[
http://issues.apache.org/jira/browse/DERBY-803?page=comments#action_12423919 ]
Deepa Remesh commented on DERBY-803:
------------------------------------
Thanks Fernanda for picking this up.
I am wondering if this solution will fix all cases. I think this solution is in
same lines as what was discussed in DERBY-1020 (use of forceClose() method) to
do a rollback and close together. At that time itself, I was not convinced this
solution will solve the problem. There are at least three different exceptions
seen during shutdown in this test (stack traces are spread between DERBY-803,
DERBY-273 and DERBY-1020). As seen from the stack traces, these exceptions can
occur at calls to conn.rollback() or conn.close(). In a previous comment, Mike
had posted another exception: "SQL Exception: No current connection. " The full
stack trace for this exception is:
java.sql.SQLException: No current connection.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:44)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:88)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:104)
at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Util.java:208)
at
org.apache.derby.impl.jdbc.EmbedConnection.checkIfClosed(EmbedConnection.java:1335)
at
org.apache.derby.impl.jdbc.EmbedConnection.setupContextStack(EmbedConnection.java:1513)
at
org.apache.derby.impl.jdbc.EmbedConnection.close(EmbedConnection.java:992)
at
org.apache.derby.impl.jdbc.EmbedConnection.close(EmbedConnection.java:970)
at org.apache.derby.impl.drda.Database.close(Database.java:320)
at org.apache.derby.impl.drda.Session.close(Session.java:110)
at
org.apache.derby.impl.drda.DRDAConnThread.closeSession(DRDAConnThread.java:7270)
at
org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:269)
This is similar to the exception I was getting when I was trying to simulate
the failure by adding a sleep. When the network server thread was sleeping, the
engine shutdown runs to completion and so I was getting "SQL Exception: No
current connection. ".
I think we can get these exceptions when we call conn.close() or
conn.rollback() during shutdown of network server and in the meantime engine
shutdown is:
1) in progress - In this case, we get
org.apache.derby.iapi.services.context.ShutdownException
2) complete - In this case, we get java.sql.SQLException: No current
connection.
I may be mistaken here but just wanted to share my thoughts.
Leaving my thoughts aside, if this patch solves the failure on your machine,
then it may be okay to proceed with this approach. I have only a small comment
about the changes in the patch. It may not be okay to remove this check "if
((conn != null) && !conn.isClosed())" before calling conn.rollbackAndClose() or
conn.close() in Database.close(). I think we need to at least check the case
that conn is not null.
> derbynet/DerbyNetAutoStart.java test fails intermittently with
> org.apache.derby.iapi.services.context.ShutdownException
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-803
> URL: http://issues.apache.org/jira/browse/DERBY-803
> Project: Derby
> Issue Type: Test
> Components: Network Server, Regression Test Failure
> Affects Versions: 10.2.0.0
> Reporter: Kathey Marsden
> Attachments: suggestion-803.diff, suggestion-803.stat
>
>
> DerbyNetAutoStart fails intermittently with the following diff:
> This issue is likely related to DERBY-1020
> ********* Diff file
> derbyall/derbynetmats/DerbyNet/derbynetmats/DerbyNetAutoStart.diff
> *** Start: DerbyNetAutoStart jdk1.4.2 DerbyNet derbynetmats:derbynetmats
> 2006-01-05 23:39:40 ***
> 1a2,3
> > org.apache.derby.iapi.services.context.ShutdownException:
> > at org.apache.derby.impl.drda.Session.close(Unknown
> > Source)agentThread[DRDAConnThread_3,5,derby.daemons]
> Test Failed.
> *** End: DerbyNetAutoStart jdk1.4.2 DerbyNet derbynetmats:derbynetmats
> 2006-01-05 23:41:10 ***
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira