db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "TomohitoNakayama" <tomon...@basil.ocn.ne.jp>
Subject Re: [jira] Commented: (DERBY-273) The derbynet/dataSourcePermissions_net.java test fails intermittently
Date Mon, 08 Aug 2005 11:35:22 GMT
Hello.

I have tried next modification to "java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java"

.

==================================================
  public void shutdown() {

   try {
+   waitSessionOfDBClosed("wombat");
+
    DriverManager.getConnection(TestUtil.getJdbcUrlPrefix("localhost",
                   NETWORKSERVER_PORT) +
           "wombat;shutdown=true",
@@ -361,7 +365,47 @@

   }
  }
+


+ private static void waitSessionOfDBClosed(String databaseName) {
+
+  try{
+   while(pollSessionOfDB(databaseName)){
+
+    Thread.sleep(1000);
+
+   }
+
+  }catch(Exception e){
+   e.printStackTrace();
+  }
+
+ }


+ private static boolean pollSessionOfDB(String databaseName) throws Exception {
+
+  String runtimeInfo =
+   networkServer.getRuntimeInfo();
+
+  return runtimeInfo.indexOf("\n" +
+        getLabel()+ databaseName) > 0;
+
+ }


+ /**
+    get label same as runtimeInfo.
+ */
+ private static String getLabel(){
+
+  LocalizedResource resource =
+   NetworkServerControlImpl.createLocalizedResource();
+
+  return resource.getTextMessage("DRDA_RuntimeInfoDatabase.I");
+
+ }


=================================

The pollSessionOfDB method executes getRuntimeInfo to NetworkServer and
if there found connection to the database , it returns true.

I found that waitSessionOfDBClosed method never ends in particular called point in the test
program.
Thinking why it happens , I realized that there exists problem of ConnectionPooling .
Physical connection in connection pool is not closed even if the connection was closed.

Talking with people,
I came to think processing in dataSourcePermissions_net.java is special as processing of program
which use ConnectionPooling,
because such programs generally do not close database by themself.


Best regards.


/*

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

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

*/
----- Original Message ----- 
From: "Kathey Marsden (JIRA)" <derby-dev@db.apache.org>
To: <tomonaka@basil.ocn.ne.jp>
Sent: Sunday, August 07, 2005 11:03 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_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
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 2005/08/04
>
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 2005/08/04


Mime
View raw message