I though I've found the problem... but I didn't.
However, shouldn't we close the Journal when we expel a Location in
StoreConnection or when we do a reset?

Index: src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java
===================================================================
--- src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java      (revision 
1158186)
+++ src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java      (working copy)
@@ -107,6 +107,7 @@
             return ;
         if ( ! force && sConn.transactionManager.activeTransactions() )
throw new TDBTransactionException("Can't expel: Active transactions for location: "+location) ;
+        sConn.transactionManager.getJournal().close() ;
         sConn.baseDSG.close() ;
         cache.remove(location) ;
     }

It doesn't make the problem below to go away.

Still searching...

Paolo

Paolo Castagna wrote:
Hi Andy,
while I was running TestTransSystem and double checking the number of
open files does not grow indefinitely, I noticed that the TDB indexes
get deleted at each iteration (but they are not recreated).

This is my attempt at fixing that:

Index: src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSystem.java
===================================================================
--- src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSystem.java (revision 1158186) +++ src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSystem.java (working copy)
@@ -126,6 +126,7 @@

     private static void clean()
     {
+        StoreConnection.reset() ;
         if ( ! LOC.isMem() )
             FileOps.clearDirectory(LOC.getDirectoryPath()) ;
     }

However, when I run the modified TestTransSystem I get this error:
"Different ids allocated: expected [0000000000000000], got [0000000000000000]"
which is not helpful.

This:

Index: src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java
===================================================================
--- src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java (revision 1158186) +++ src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java (working copy)
@@ -144,7 +144,7 @@
             Node node = x.getRight() ;
             NodeId nodeId2 = base.getAllocateNodeId(node) ;
             if ( ! nodeId2.equals(mapFromJournal(nodeId)) )
- throw new TDBException(String.format("Different ids allocated: expected %s, got %s\n", nodeId, nodeId2)) ; + throw new TDBException(String.format("Different ids allocated: expected %s, got %s\n", mapFromJournal(nodeId), nodeId2)) ;
         }
     }

gives us:
"Different ids allocated: expected [000000000000000E], got [0000000000000000]"

I still do not know what's going wrong, I am posting here to see if
you have any useful suggestion.

Thanks,
Paolo

Andy Seaborne wrote:


On 15/08/11 13:57, Paolo Castagna wrote:
Hi Andy,
NodeTableTrans has an empty implementation for the close() method.

Shouldn't we call close on journal (i.e. journal.close()) and, possibly,
on base (i.e. base.close())?

I can easily run into troubles using TestTransSystem with an on-disk
location instead of an in-memory one. After a while, you hit the
problem: "Too many open files".

Calling journal.close() seems to fix it.

Paolo

Yes - it does seem to fix it although some tests are affected (the test look wrong). The intent was (I think) to allow for reusable transaction objects to avoid the churn cost of java objects but it's a false economy.

    Andy


Reply via email to