You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Jack Klebanoff (JIRA)" <de...@db.apache.org> on 2005/05/11 23:55:12 UTC

[jira] Created: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

The derbynet/dataSourcePermissions_net.java test fails intermittently
---------------------------------------------------------------------

         Key: DERBY-273
         URL: http://issues.apache.org/jira/browse/DERBY-273
     Project: Derby
        Type: Bug
 Environment: 1.4.2 JVM (both Sun and IBM)
    Reporter: Jack Klebanoff


The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
*** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
17a18,19
> org.apache.derby.iapi.services.context.ShutdownException: 
> agentThread[DRDAConnThread_2,5,derby.daemons]
Test Failed.


-- 
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


[jira] Reopened: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]
     
Tomohito Nakayama reopened DERBY-273:
-------------------------------------


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


Re: [jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by Øystein Grøvlen <Oy...@Sun.COM>.
>>>>> "KM" == Kathey Marsden <km...@sbcglobal.net> writes:

    KM> Just a bit of history.

    KM> It used to be with Cloudscape that you could close a connection without
    KM> rolling back. The rollback would be automatic.
    KM> In Derby you have to do an explicit rollback before closing the
    KM> connection if  there is a transaction.  That is why the rollback is
    KM> there in Database.close().

What happens to the transaction if you don't terminate it (rollback or
commit) before closing the connection?  Will it just hang forever?

-- 
Øystein


Re: [jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by Kathey Marsden <km...@sbcglobal.net>.
TomohitoNakayama wrote:

> Hello.
>
> Thank you for your advise.
>
> I have some unconfortable feeling around rollback ....

Just a bit of history.

It used to be with Cloudscape that you could close a connection without
rolling back. The rollback would be automatic.
In Derby you have to do an explicit rollback before closing the
connection if  there is a transaction.  That is why the rollback is
there in Database.close().




Re: [jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by TomohitoNakayama <to...@basil.ocn.ne.jp>.
Hello.

Thank you for your advise.

I have some unconfortable feeling around rollback ....

Kathey wrote:
> Database.close() should only throw an exception if the connection
> fails to close, not if the rollback fails.
Do you mean that fail of rollback is no problem, because undo will be done 
in recovery process.... ?

Well ... some more hacking in stacktrace would be needed for me.
I'm not yet sure the exact part in rollback where ShutdownException is 
happen.

Best regards.

/*

         Tomohito Nakayama
         tomonaka@basil.ocn.ne.jp
         tomohito@rose.zero.ad.jp

         Naka
         http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/
----- Original Message ----- 
From: "Kathey Marsden" <km...@sbcglobal.net>
To: "Derby Development" <de...@db.apache.org>
Sent: Wednesday, June 08, 2005 11:56 AM
Subject: Re: [jira] Commented: (DERBY-273) The 
derbynet/dataSourcePermissions_net.java test fails intermittently


> Tomohito Nakayama (JIRA) wrote:
>
>>I suspect there exists remaining previous thread concerning with that 
>>database , when
>>
> Yes, probably one connection shutdown the database intentionally , and
> then another had trouble doing  a rollback in Database.close(), that
> exception is  to be expected but we need to make sure the connection
> closes properly.
>
>>shutting down the database...
>>Then ShutdownException is thrown from previous working thread , I wonder.
>>
>>
>>
> More details
>
> SYMPTOM
>    - The  test shuts down the database intentionally with shudown=true.
>    - When a database has been  shutdown and connections terminate,  an
> exception may occur in Database.close() on rollback.         It depends
> on timing and  is not a problem. The trouble  is that if that an error
> occurs on rollback we never close
>        the connection and clean up properly.
>    - Network Server prints exceptions that occur when closing the
> connection  to the console, because failing to
>       close the connection  can cause a leak.
>    - Depending on timing you may or may not see the exception print to
> the console.
>
> POSSIBLE SOLUTION
>    Database.close() should only throw an exception if the connection
> fails to close, not if the rollback fails.
>     i.e. catch the rollback exception and proceed with conn.close()
>
> There is yet more detailed information in the Jira entry description of
> the problem.
>
> I hope this helps.
>
> Kathey
>
>
>>>The derbynet/dataSourcePermissions_net.java test fails intermittently
>>>---------------------------------------------------------------------
>>>
>>>         Key: DERBY-273
>>>         URL: http://issues.apache.org/jira/browse/DERBY-273
>>>     Project: Derby
>>>        Type: Bug
>>> Environment: 1.4.2 JVM (both Sun and IBM)
>>>    Reporter: Jack Klebanoff
>>>    Assignee: Tomohito Nakayama
>>>
>>>
>>
>>
>>
>>>The test fails in the derbyall/derbynetclientmats/derbynetmats suite 
>>>stack with the following diff:
>>>*** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient 
>>>derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
>>>17a18,19
>>>
>>>
>>>>org.apache.derby.iapi.services.context.ShutdownException:
>>>>agentThread[DRDAConnThread_2,5,derby.daemons]
>>>>
>>>>
>>>Test Failed.
>>>
>>>
>>
>>
>>
>
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.5 - Release Date: 2005/06/07
>
> 



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.5 - Release Date: 2005/06/07


Re: [jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by Kathey Marsden <km...@sbcglobal.net>.
Tomohito Nakayama (JIRA) wrote:

>I suspect there exists remaining previous thread concerning with that database , when 
>
Yes, probably one connection shutdown the database intentionally , and
then another had trouble doing  a rollback in Database.close(), that
exception is  to be expected but we need to make sure the connection
closes properly.

>shutting down the database... 
>Then ShutdownException is thrown from previous working thread , I wonder.
>
>  
>
More details
  
SYMPTOM
    - The  test shuts down the database intentionally with shudown=true.
    - When a database has been  shutdown and connections terminate,  an 
exception may occur in Database.close() on rollback.         It depends
on timing and  is not a problem. The trouble  is that if that an error
occurs on rollback we never close
        the connection and clean up properly.
    - Network Server prints exceptions that occur when closing the
connection  to the console, because failing to
       close the connection  can cause a leak.
    - Depending on timing you may or may not see the exception print to
the console.

POSSIBLE SOLUTION
    Database.close() should only throw an exception if the connection
fails to close, not if the rollback fails.
     i.e. catch the rollback exception and proceed with conn.close()

There is yet more detailed information in the Jira entry description of
the problem.

I hope this helps.

Kathey


>>The derbynet/dataSourcePermissions_net.java test fails intermittently
>>---------------------------------------------------------------------
>>
>>         Key: DERBY-273
>>         URL: http://issues.apache.org/jira/browse/DERBY-273
>>     Project: Derby
>>        Type: Bug
>> Environment: 1.4.2 JVM (both Sun and IBM)
>>    Reporter: Jack Klebanoff
>>    Assignee: Tomohito Nakayama
>>    
>>
>
>  
>
>>The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
>>*** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
>>17a18,19
>>    
>>
>>>org.apache.derby.iapi.services.context.ShutdownException: 
>>>agentThread[DRDAConnThread_2,5,derby.daemons]
>>>      
>>>
>>Test Failed.
>>    
>>
>
>  
>



[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12312889 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

I have read the dataSourcePermissions_net.

dataSourcePermissions_net  executes network version of test executed in dataSourcePermissions.
Content of tests was implemented in dataSourcePermissions.runTest().

In the test, 
there exist  parts where it is repeated , to create connection to database named wombat and to shut down database via the connection.

Reported exception seems to happen in this repeating part.
...see http://issues.apache.org/jira/secure/attachment/20380/derbyall_diff.txt also.

I suspect there exists remaining previous thread concerning with that database , when shutting down the database... 
Then ShutdownException is thrown from previous working thread , I wonder.

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12367494 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

Committed DERBY-273_2.patch

Sending        java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
Sending        java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testSecMec.java
Transmitting file data ..
Committed revision 380099.


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch, DERBY-273_2.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12367020 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

I was not conscious for modification of public API.
I think it is possible to go on alternative way ,which does not need new method.

I will submit patch again for this issue.

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12316930 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

Summary of what I knew in this issue ever ...

The phenomena found in this issue happens when closing connection falls on shutting down database. 
To make the phenomena not happen , it is needed to ensure closure of connection before shutting down database. 
However, it is impossible to close  connection in ConnectionPool only using jdbc interface.

Then, I think connection managment mechanism outside jdbc is needed to solve this issue ....



> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Updated: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]

Tomohito Nakayama updated DERBY-273:
------------------------------------

    Attachment: DERBY-273.patch

Description of patch :
   Alter where derbynet/dataSourcePermissions_net.java print ShutdownException from System.out to shutdown.log.

Test :
   Execute derbyall and found no error.


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12313153 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

In my previous comment, I wrote as next.

>In the test, 
>there exist parts where it is repeated , to create connection to database named wombat and to shut down database via the connection.

This is incorrect.
Database was shutdown via "another" connection using "jdbc:derby:;shutdown=true", 
though there exists another connections .

Well ...
Now I think ShutdownException thrown by rollback process should be treated as Exception.
User should not shutdown Database if there remain connections ....
Then, Exception in test result itself was truly Exception. 

And futhermore, connection should be surely closed , 
though Database was earlier closed and Exception happens in rollback ....


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12366969 ] 

Kathey Marsden commented on DERBY-273:
--------------------------------------

I noticed that the patch for this issue added a new method to the public API.
 
I think if  the public API is being changed we should 
1) Add a  new Jira issue for that so people know what is being added and can comment
2) Understand why  we need a new public method in the API
3) Have javadoc for the api call.


I almost missed this all together because it was not mentioned in the patch comments.
I thought it was just a test modification.  When i updated my client I saw NetworkServerControl had changed so took a look.




> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_65999 ]
     
Kathey Marsden commented on DERBY-273:
--------------------------------------

When network server closes a session, it tries to perform a rollback on the connection before closing the connection. If it encounters an exception during rollback it treats the exception as an unexpected exception and prints the error to the console. 

However, in this case, the database has been intentionally shut down and the error on rollback is expected. Network Server should treat an error on rollback, when closing a session, as an expected exception if the database has been intentionally shut down. 

The intermittent nature of this diff seems to be related to when the session for the disconnected client that shutdown the database gets cleaned up. 

When the test fails, this is the trace in the tmp file: 

org.apache.derby.iapi.services.context.ShutdownException: 
at org.apache.derby.iapi.services.context.ContextManager.checkInterrupt(ContextManager.java:374) 
at org.apache.derby.iapi.services.context.ContextManager.popContext(ContextManager.java:152) 
at org.apache.derby.iapi.services.context.ContextImpl.popMe(ContextImpl.java:80) 
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.resetSavepoints(GenericLanguageConnectionContext.java:1309) 
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.doRollback(GenericLanguageConnectionContext.java:1288) 
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.userRollback(GenericLanguageConnectionContext.java:1199) 
at org.apache.derby.impl.jdbc.TransactionResourceImpl.rollback(TransactionResourceImpl.java:244) 
agentThread[DRDAConnThread_3,5,derby.daemons] 
at org.apache.derby.impl.jdbc.EmbedConnection.rollback(EmbedConnection.java:894) 
at org.apache.derby.impl.drda.Database.close(Database.java:352) 
at org.apache.derby.impl.drda.Session.close(Session.java:110) 
at org.apache.derby.impl.drda.DRDAConnThread.closeSession(DRDAConnThread.java:6803) 
at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:241) 
EXPECTED SHUTDOWN DERBY SQL error: SQLCODEWhen network server closes a session, it tries to perform a rollback on the connection before closing the connection. If it encounters an exception during rollback it treats the exception as an unexpected exception and prints the error to the console. 

However, in this case, the database has been intentionally shut down and the error on rollback is expected. Network Server should treat an error on rollback, when closing a session, as an expected exception if the database has been intentionally shut down. 

The intermittent nature of this diff seems to be related to when the session for the disconnected client that shutdown the database gets cleaned up. 

When the test fails, this is the trace in the tmp file: 

org.apache.derby.iapi.services.context.ShutdownException: 
at org.apache.derby.iapi.services.context.ContextManager.checkInterrupt(ContextManager.java:374) 
at org.apache.derby.iapi.services.context.ContextManager.popContext(ContextManager.java:152) 
at org.apache.derby.iapi.services.context.ContextImpl.popMe(ContextImpl.java:80) 
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.resetSavepoints(GenericLanguageConnectionContext.java:1309) 
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.doRollback(GenericLanguageConnectionContext.java:1288) 
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.userRollback(GenericLanguageConnectionContext.java:1199) 
at org.apache.derby.impl.jdbc.TransactionResourceImpl.rollback(TransactionResourceImpl.java:244) 
agentThread[DRDAConnThread_3,5,derby.daemons] 
at org.apache.derby.impl.jdbc.EmbedConnection.rollback(EmbedConnection.java:894) 
at org.apache.derby.impl.drda.Database.close(Database.java:352) 
at org.apache.derby.impl.drda.Session.close(Session.java:110) 
at org.apache.derby.impl.drda.DRDAConnThread.closeSession(DRDAConnThread.java:6803) 
at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:241) 
EXPECTED SHUTDOWN DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006 ...

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12367047 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

Writing and testing the new patch, I found manipulating log writer which exists in NetworkServerControlImpl seems to be insufficient...
I could find error was printed to *.out file, though stream for file was passed via constructor.
 
Now, I'm trying to utilize System.setOut and System.setErr instead.
This method seems to work well.

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12367048 ] 

Kathey Marsden commented on DERBY-273:
--------------------------------------

So are you saying that you start the server with the NetworkServerControl method
	public void start(PrintWriter consoleWriter) throws Exception

but messages are still going to System.out and System.err?


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Updated: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]

Kathey Marsden updated DERBY-273:
---------------------------------

    Fix Version: 10.2.0.0

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug

>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>      Fix For: 10.2.0.0
>  Attachments: DERBY-273.patch, DERBY-273_2.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12367073 ] 

Kathey Marsden commented on DERBY-273:
--------------------------------------

I don't think for this test any of the console output needs to go to System.out.  The test is not for testing the console output.
I think that it would be sufficient just start with an alternate console, e.g. DerbyNet.out and all the console output can go there.  
I don't  understand why we need code to alter destination stream before and after shutting down network server



> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12313361 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

I read code org.apache.derby.impl.drda.Database#close();
http://svn.apache.org/repos/asf/incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java

Documentation comment for this method said 
"Close the connection and clean up the statement table.".

Reading the code , I found there are next processing

1:if stmtTable exists, call every DRDAStatement.close() in stmtTable.
2:if conn exists
	2-1:call conn.rollback() 
	2-2:call conn.close().

If exception happens in conn.rollback() of 2-1 ,
conn.close() of 2-2 would be not called as Kathey suggested in previous mail.
http://mail-archives.apache.org/mod_mbox/db-derby-dev/200506.mbox/%3c42A65E51.6010800@sbcglobal.net%3e


I think conn.close() should be called in finally clause in this method.


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Resolved: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]
     
Tomohito Nakayama resolved DERBY-273:
-------------------------------------

    Resolution: Fixed

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch, DERBY-273_2.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12313385 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

Consequently, there exists two matter to do.

modify-1: 
Modify scenario of dataSourcePermissions not to shutdown when connection exists.
This will supress errors in test.

modify-2: 
Modify how conn.rollback() is called in org.apache.derby.impl.drda.Database#close() ,
and make it sure for connection to be closed in exceptional state.

Now problem exits in modify-2.
How can this to be tested ?
The modify-2 can be confirmed under exceptional state that happens indeterministically ...




> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Updated: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Andrew McIntyre (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]

Andrew McIntyre updated DERBY-273:
----------------------------------

    Component: Regression Test Failure

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Assigned: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]

Tomohito Nakayama reassigned DERBY-273:
---------------------------------------

    Assign To: Tomohito Nakayama

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Updated: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]

Kathey Marsden updated DERBY-273:
---------------------------------

    Comment: was deleted

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Updated: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]

Tomohito Nakayama updated DERBY-273:
------------------------------------

    Attachment: DERBY-273_2.patch

Description of the patch :
   Alter output before and after shutting down database and 
   escape ShutDownException was printed to console.
   This modification was done in derbynet/dataSourcePermissions_net.java and derbynet/testSecMec.java which is subclass of former.

Test:
   Execute derbynet/dataSourcePermissions_net.java and Shutting down exception was printed to altered log file.
   I did same test on derbynet/testSecMec.java. 
   However ShutdownException was not recorded in both of log file and console.
   It seems that problematic ShutdownException was not happen.
 

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch, DERBY-273_2.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12317911 ] 

Kathey Marsden commented on DERBY-273:
--------------------------------------

I have not been able to follow this thread closely, but I don't think I understand how Connection Pooling relates to this problem.   Can you post a bit of java code or a standalone java program that demonstrates the issue?


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Resolved: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]
     
Tomohito Nakayama resolved DERBY-273:
-------------------------------------

    Resolution: Fixed

The patch committed.

Sending        java/drda/org/apache/derby/drda/NetworkServerControl.java
Sending        java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
Transmitting file data ..
Committed revision 378903.


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama
>  Attachments: DERBY-273.patch
>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Updated: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Mike Matrigali (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]

Mike Matrigali updated DERBY-273:
---------------------------------

      Component: Network Server
    Description: 
The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
*** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
17a18,19
> org.apache.derby.iapi.services.context.ShutdownException: 
> agentThread[DRDAConnThread_2,5,derby.daemons]
Test Failed.


  was:
The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
*** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
17a18,19
> org.apache.derby.iapi.services.context.ShutdownException: 
> agentThread[DRDAConnThread_2,5,derby.daemons]
Test Failed.



> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


Re: [jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by TomohitoNakayama <to...@basil.ocn.ne.jp>.
Hello.

Exact shutdown was processed in 
org.apache.derby.impl.services.monitor.BaseMonitor.shutdown();

Modifying this part of code would make engine to wait connection closed 
before shutdown.
Though I don't have concluded it is a moderate plan yet ....

Best regards.

/*

         Tomohito Nakayama
         tomonaka@basil.ocn.ne.jp
         tomohito@rose.zero.ad.jp

         Naka
         http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/
----- Original Message ----- 
From: "TomohitoNakayama" <to...@basil.ocn.ne.jp>
To: "Derby Development" <de...@db.apache.org>
Sent: Tuesday, June 14, 2005 12:17 AM
Subject: Re: [jira] Commented: (DERBY-273) The 
derbynet/dataSourcePermissions_net.java test fails intermittently


> Hello.
>
> Thank you for your help.
>
> Well ...
> I will think and hack for a little more.
>
> I read code around shutdown database ...
>
> Best regards.
>
> /*
>
>         Tomohito Nakayama
>         tomonaka@basil.ocn.ne.jp
>         tomohito@rose.zero.ad.jp
>
>         Naka
>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
>
> */
> ----- Original Message ----- 
> From: "Kathey Marsden (JIRA)" <de...@db.apache.org>
> To: <de...@db.apache.org>
> Sent: Monday, June 13, 2005 10:54 PM
> Subject: [jira] Commented: (DERBY-273) The 
> derbynet/dataSourcePermissions_net.java test fails intermittently
>
>
>>    [ 
>> http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12313468 ]
>>
>> Kathey Marsden commented on DERBY-273:
>> --------------------------------------
>>
>> I have two ideas, neither of which seem ideal but maybe they will give 
>> you a better idea.
>>
>> 1) If the exception is intermittent but not harmful you could specify an 
>> alternate consoleWriter when you call NetworkServerControl.start().  This 
>> way the exception does not print to System.out.
>> This would mean that dataSourcePermissions_net.java would suffer the same 
>> deficiencey as the other tests, that the console is not monitored 
>> properly by the test.
>>
>>
>> 2) The NetworkServerControl method getRuntimeInfo will show the 
>> connection info from the server's perspective.  You could alternately 
>> sleep for a few seconds and call this method to see the connections from 
>> the server perspective.  The output is a string that would need to be 
>> parsed. It has output that looks like:
>> # Connection Threads : 2
>> # Active Sessions : 2
>> # Waiting  Sessions : 0
>>
>> And always includes one session for the runtimeinfo request.
>>
>>
>>
>>
>>> The derbynet/dataSourcePermissions_net.java test fails intermittently
>>> ---------------------------------------------------------------------
>>>
>>>          Key: DERBY-273
>>>          URL: http://issues.apache.org/jira/browse/DERBY-273
>>>      Project: Derby
>>>         Type: Bug
>>>  Environment: 1.4.2 JVM (both Sun and IBM)
>>>     Reporter: Jack Klebanoff
>>>     Assignee: Tomohito Nakayama
>>
>>>
>>> The test fails in the derbyall/derbynetclientmats/derbynetmats suite 
>>> stack with the following diff:
>>> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient 
>>> derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
>>> 17a18,19
>>> > org.apache.derby.iapi.services.context.ShutdownException:
>>> > agentThread[DRDAConnThread_2,5,derby.daemons]
>>> Test Failed.
>>
>> -- 
>> 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
>>
>>
>>
>>
>> -- 
>> No virus found in this incoming message.
>> Checked by AVG Anti-Virus.
>> Version: 7.0.323 / Virus Database: 267.6.9 - Release Date: 2005/06/11
>>
>>
>
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.9 - Release Date: 2005/06/11
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.9 - Release Date: 2005/06/11
>
> 



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.9 - Release Date: 2005/06/11


Re: [jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by TomohitoNakayama <to...@basil.ocn.ne.jp>.
Hello.

Thank you for your help.

Well ...
I will think and hack for a little more.

I read code around shutdown database ...

Best regards.

/*

         Tomohito Nakayama
         tomonaka@basil.ocn.ne.jp
         tomohito@rose.zero.ad.jp

         Naka
         http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/
----- Original Message ----- 
From: "Kathey Marsden (JIRA)" <de...@db.apache.org>
To: <de...@db.apache.org>
Sent: Monday, June 13, 2005 10:54 PM
Subject: [jira] Commented: (DERBY-273) The 
derbynet/dataSourcePermissions_net.java test fails intermittently


>    [ 
> http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12313468 ]
>
> Kathey Marsden commented on DERBY-273:
> --------------------------------------
>
> I have two ideas, neither of which seem ideal but maybe they will give you 
> a better idea.
>
> 1) If the exception is intermittent but not harmful you could specify an 
> alternate consoleWriter when you call NetworkServerControl.start().  This 
> way the exception does not print to System.out.
> This would mean that dataSourcePermissions_net.java would suffer the same 
> deficiencey as the other tests, that the console is not monitored properly 
> by the test.
>
>
> 2) The NetworkServerControl method getRuntimeInfo will show the connection 
> info from the server's perspective.  You could alternately sleep for a few 
> seconds and call this method to see the connections from the server 
> perspective.  The output is a string that would need to be parsed. It has 
> output that looks like:
> # Connection Threads : 2
> # Active Sessions : 2
> # Waiting  Sessions : 0
>
> And always includes one session for the runtimeinfo request.
>
>
>
>
>> The derbynet/dataSourcePermissions_net.java test fails intermittently
>> ---------------------------------------------------------------------
>>
>>          Key: DERBY-273
>>          URL: http://issues.apache.org/jira/browse/DERBY-273
>>      Project: Derby
>>         Type: Bug
>>  Environment: 1.4.2 JVM (both Sun and IBM)
>>     Reporter: Jack Klebanoff
>>     Assignee: Tomohito Nakayama
>
>>
>> The test fails in the derbyall/derbynetclientmats/derbynetmats suite 
>> stack with the following diff:
>> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient 
>> derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
>> 17a18,19
>> > org.apache.derby.iapi.services.context.ShutdownException:
>> > agentThread[DRDAConnThread_2,5,derby.daemons]
>> Test Failed.
>
> -- 
> 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
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.9 - Release Date: 2005/06/11
>
> 



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.9 - Release Date: 2005/06/11


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12313468 ] 

Kathey Marsden commented on DERBY-273:
--------------------------------------

I have two ideas, neither of which seem ideal but maybe they will give you a better idea.

1) If the exception is intermittent but not harmful you could specify an alternate consoleWriter when you call NetworkServerControl.start().  This way the exception does not print to System.out.  
This would mean that dataSourcePermissions_net.java would suffer the same deficiencey as the other tests, that the console is not monitored properly by the test.


2) The NetworkServerControl method getRuntimeInfo will show the connection info from the server's perspective.  You could alternately sleep for a few seconds and call this method to see the connections from the server perspective.  The output is a string that would need to be parsed. It has output that looks like:
# Connection Threads : 2
# Active Sessions : 2
# Waiting  Sessions : 0

And always includes one session for the runtimeinfo request.


 

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12314045 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

To accomplish plan-2,
count of session need to be polled to know wheter all session was closed ...

There are next two option.

option1:
Adding NetworkServerControl#getCountOfSession() method , which retrieve count of sessions from NetworkServerControl.

option2:
Using getRuntimeInfo() method and parse result of it.

In a glance , option1 seems to be straight answer.
However , NetworkServerControl#getCountOfSession() have wrong impact to make confusion in future.
Because count of session would be vary after the value is retrieved , accessd by other threads.

I think count of session is very private information in NetworkServerControl , 
and should not be retrieved directly from NetworkServerControl.


I think it is moderate to take option2 ,
regarding user checking state of connection seeing getRuntimeInfo ...



> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12313462 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

Regarding modify-1, there was a wrong guess in my previous thought.

I thought database was shutdown before closing connection , then connection remains in the dataSourcePermissions test.
However, I found connection was closed before shutting down database in the test.


To know why connection remains, 
I read the code around DRDAConnThread.
http://svn.apache.org/repos/asf/incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java

In last part of DRDAConnThread#run() ,
I found  closing connection at server was caused by DRDAProtocolException that stands for disconnection.

This exeption was caused in DDMReader and DDMWriter , calling DRDAConnThread#markCommunicationsFailure when catching IOException.
http://svn.apache.org/repos/asf/incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java
http://svn.apache.org/repos/asf/incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java


I guess client close the connection one-sidely and 
DRDAProtocolException representing disconnection happens in server , 
and rollback and close connection at server follows .

Because client is one-side player , client doesn't know wheter server finished work of closing connection .


Then ... how to ensure finishing closing connection before shutting down database ...? 

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12313814 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

The alternate plans ....

alternate-plan-1:
Not to output message of exception to STDOUT

alternate-plan-2:
In the test program , wait to session closed seeing return value of 
NetworkServerControl#getRuntimeInfo

alternate-plan-3:
Modify shutdown process to wait session closed. 


I think 

alternate-plan-1 have problem that
the message of exception should be shown to the user.

alternate-plan-3 have problem that 
If it was failed to close session, shutdown will fail.


I think direction of alternation-2 would be best.
I will survey one more how to detect all session was closed.


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Updated: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Mike Matrigali (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=all ]

Mike Matrigali updated DERBY-273:
---------------------------------

    Environment: 
1.4.2 JVM (both Sun and IBM)
1.5.0_02  JVM (sun)

  was:1.4.2 JVM (both Sun and IBM)


> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>   Components: Network Server, Regression Test Failure
>  Environment: 1.4.2 JVM (both Sun and IBM)
> 1.5.0_02  JVM (sun)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Tomohito Nakayama (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_12312740 ] 

Tomohito Nakayama commented on DERBY-273:
-----------------------------------------

I have started to survey ...


My first question was "What is ShutdownException ?"

JavaDoc told "A ShutdownException is a runtime exception that is used to notify code that the system has/is being shut down. "
http://incubator.apache.org/derby/javadoc/engine/org/apache/derby/iapi/services/context/ShutdownException.html

Grepping whole code ,I found ShutdownException was thrown only from next two part.
./engine/org/apache/derby/iapi/services/context/ContextManager.java:374:			throw new ShutdownException();
./engine/org/apache/derby/iapi/services/context/ContextService.java:124:			throw new ShutdownException();

Reading each class, I found that these part are executed only when ContextManager or ContextService is in state of shutdown or  stopped.

These codes completely match explanation in JavaDoc.
Each object is in state of shutdown , and ShutdownException happens.


Then, next question arise.
Why there happens situation of  system has/is being shut down during running in  DRDAConnThread as reported ?

I think reading dataSourcePermissions_net will give me answer.

> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff
>     Assignee: Tomohito Nakayama

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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


[jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-273?page=comments#action_65997 ]
     
Kathey Marsden commented on DERBY-273:
--------------------------------------

When network server closes a session, it tries to perform a rollback on the connection before closing the connection.  If it encounters an exception during rollback it treats the exception as an unexpected exception and prints the error to the console.  

However, in this case,  the database has been intentionally shut down and the error on rollback is expected.  Network Server should treat an error on rollback, when closing a session, as an expected exception if the database has been intentionally shut down.

The intermittent nature of this diff seems to be related to when the session for the disconnected client that shutdown the database gets cleaned up.  

When the test fails, this is the trace in the tmp file:

org.apache.derby.iapi.services.context.ShutdownException: 
	at org.apache.derby.iapi.services.context.ContextManager.checkInterrupt(ContextManager.java:374)
	at org.apache.derby.iapi.services.context.ContextManager.popContext(ContextManager.java:152)
	at org.apache.derby.iapi.services.context.ContextImpl.popMe(ContextImpl.java:80)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.resetSavepoints(GenericLanguageConnectionContext.java:1309)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.doRollback(GenericLanguageConnectionContext.java:1288)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.userRollback(GenericLanguageConnectionContext.java:1199)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.rollback(TransactionResourceImpl.java:244)
agentThread[DRDAConnThread_3,5,derby.daemons]
	at org.apache.derby.impl.jdbc.EmbedConnection.rollback(EmbedConnection.java:894)
	at org.apache.derby.impl.drda.Database.close(Database.java:352)
	at org.apache.derby.impl.drda.Session.close(Session.java:110)
	at org.apache.derby.impl.drda.DRDAConnThread.closeSession(DRDAConnThread.java:6803)
	at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:241)
EXPECTED SHUTDOWN DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: wombat08006.DDatabase 'wombat' shutdown.(server log:D:\dev\src\JarResults.2005-05-19\jdk142_derbyall\derbyall\derbynetclientmats\DerbyNetClient\derbynetmats\derbynetmats\dataSourcePermissions_net\derby.log




> The derbynet/dataSourcePermissions_net.java test fails intermittently
> ---------------------------------------------------------------------
>
>          Key: DERBY-273
>          URL: http://issues.apache.org/jira/browse/DERBY-273
>      Project: Derby
>         Type: Bug
>  Environment: 1.4.2 JVM (both Sun and IBM)
>     Reporter: Jack Klebanoff

>
> The test fails in the derbyall/derbynetclientmats/derbynetmats suite stack with the following diff:
> *** Start: dataSourcePermissions_net jdk1.4.2 DerbyNetClient derbynetmats:derbynetmats 2005-05-11 04:24:11 ***
> 17a18,19
> > org.apache.derby.iapi.services.context.ShutdownException: 
> > agentThread[DRDAConnThread_2,5,derby.daemons]
> Test Failed.

-- 
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