portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/persistence/src/java/org/apache/jetspeed/components/persistence/store/ojb/pb PBStore.java
Date Thu, 04 Mar 2004 22:11:00 GMT
weaver      2004/03/04 14:11:00

  Modified:    components/persistence/src/java/org/apache/jetspeed/components/persistence/store/ojb/pb
                        PBStore.java
  Log:
  automatically recovers if its internal PersistenceBroker has been closed
  
  Revision  Changes    Path
  1.2       +35 -2     jakarta-jetspeed-2/components/persistence/src/java/org/apache/jetspeed/components/persistence/store/ojb/pb/PBStore.java
  
  Index: PBStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/persistence/src/java/org/apache/jetspeed/components/persistence/store/ojb/pb/PBStore.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PBStore.java	4 Mar 2004 21:20:07 -0000	1.1
  +++ PBStore.java	4 Mar 2004 22:11:00 -0000	1.2
  @@ -102,10 +102,12 @@
        */
       public void close()
       {
  +        invoker.beforeClose();
           if (!pb.isClosed())
           {
               pb.close();
           }
  +        invoker.afterClose();
   
       }
   
  @@ -144,6 +146,10 @@
           invoker.beforeLookup();
           try
           {
  +            if(pb.isClosed())
  +            {
  +                PersistenceBrokerFactory.createPersistenceBroker(pbKey);
  +            }
               return pb.getCollectionByQuery((Query) query);
           }
           finally
  @@ -169,6 +175,10 @@
           invoker.beforeLookup();
           try
           {
  +            if(pb.isClosed())
  +            {
  +                PersistenceBrokerFactory.createPersistenceBroker(pbKey);
  +            }
               return pb.getObjectByQuery((Query) query);
           }
           finally
  @@ -193,6 +203,10 @@
           invoker.beforeLookup();
           try
           {
  +            if(pb.isClosed())
  +            {
  +                PersistenceBrokerFactory.createPersistenceBroker(pbKey);
  +            }
               return pb.getObjectByIdentity(new Identity(object, pb));
           }
           finally
  @@ -215,8 +229,11 @@
        */
       public int getCount(Object query)
       {
  -       
  -            return pb.getCount((Query) query);
  +        if (pb.isClosed())
  +        {
  +            PersistenceBrokerFactory.createPersistenceBroker(pbKey);
  +        }
  +        return pb.getCount((Query) query);
          
       }
   
  @@ -228,6 +245,10 @@
           invoker.beforeLookup();
           try
           {
  +            if(pb.isClosed())
  +            {
  +                PersistenceBrokerFactory.createPersistenceBroker(pbKey);
  +            }
               return pb.getIteratorByQuery((Query) query);
           }
           finally
  @@ -322,6 +343,10 @@
           try
           {
               invoker.beforeMakePersistent();
  +            if(pb.isClosed())
  +            {
  +                PersistenceBrokerFactory.createPersistenceBroker(pbKey);
  +            }
               pb.store(obj);
               invoker.afterMakePersistent();
           }
  @@ -356,6 +381,10 @@
           invoker.beforeLookup();
           try
           {
  +            if(pb.isClosed())
  +            {
  +                PersistenceBrokerFactory.createPersistenceBroker(pbKey);
  +            }
               return pb.getCollectionByQuery(QueryFactory.newQuery(clazz, new Criteria()));
           }
           finally
  @@ -376,6 +405,10 @@
        */
       public void invalidateAll() throws LockFailedException
       {
  +        if(pb.isClosed())
  +        {
  +            PersistenceBrokerFactory.createPersistenceBroker(pbKey);
  +        }
           pb.clearCache();
       }
       
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message