db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/core PoolablePersistenceBroker.java PersistenceBrokerFactoryDefaultImpl.java
Date Sun, 04 Jan 2004 18:20:31 GMT
arminw      2004/01/04 10:20:31

  Modified:    src/java/org/apache/ojb/broker/core
                        PoolablePersistenceBroker.java
                        PersistenceBrokerFactoryDefaultImpl.java
  Log:
  do more cleanup when PB instance was destroyed
  
  Revision  Changes    Path
  1.2       +6 -1      db-ojb/src/java/org/apache/ojb/broker/core/PoolablePersistenceBroker.java
  
  Index: PoolablePersistenceBroker.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/PoolablePersistenceBroker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PoolablePersistenceBroker.java	26 Apr 2003 23:18:25 -0000	1.1
  +++ PoolablePersistenceBroker.java	4 Jan 2004 18:20:31 -0000	1.2
  @@ -37,4 +37,9 @@
               return false;
           }
       }
  +
  +    public void destroy()
  +    {
  +        this.setDelegate(null);
  +    }
   }
  
  
  
  1.6       +6 -3      db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactoryDefaultImpl.java
  
  Index: PersistenceBrokerFactoryDefaultImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactoryDefaultImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PersistenceBrokerFactoryDefaultImpl.java	28 Oct 2003 21:18:48 -0000	1.5
  +++ PersistenceBrokerFactoryDefaultImpl.java	4 Jan 2004 18:20:31 -0000	1.6
  @@ -188,7 +188,8 @@
           try
           {
               brokerPool.clear();
  -            //release all resources regarding the connection pooling
  +            // TODO: should we setup a new pool instance?
  +            //brokerPool = this.createPool();
           }
           catch (Exception e)
           {
  @@ -271,12 +272,14 @@
            */
           public void destroyObject(Object key, Object obj) throws Exception
           {
  -            PersistenceBroker broker = ((PoolablePersistenceBroker) obj).getInnermostDelegate();
  +            PoolablePersistenceBroker pb = (PoolablePersistenceBroker) obj;
  +            PersistenceBroker broker = pb.getInnermostDelegate();
               if (broker instanceof PersistenceBrokerImpl)
               {
                   log.info("Destroy PersistenceBroker instance " + obj);
                   ((PersistenceBrokerImpl) broker).destroy();
               }
  +            pb.destroy();
           }
   
           /**
  
  
  

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


Mime
View raw message