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 PersistenceBrokerFactoryDefaultImpl.java
Date Tue, 06 Sep 2005 22:13:54 GMT
arminw      2005/09/06 15:13:54

  Modified:    src/java/org/apache/ojb/broker/core
                        PersistenceBrokerFactoryDefaultImpl.java
  Log:
  synchronize lookup of PB instances
  
  Revision  Changes    Path
  1.16      +9 -2      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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- PersistenceBrokerFactoryDefaultImpl.java	27 Aug 2005 12:12:10 -0000	1.15
  +++ PersistenceBrokerFactoryDefaultImpl.java	6 Sep 2005 22:13:54 -0000	1.16
  @@ -80,8 +80,15 @@
        * @return
        * @throws PBFactoryException
        */
  -    public PersistenceBrokerInternal createPersistenceBroker() throws PBFactoryException
  +    public synchronized PersistenceBrokerInternal createPersistenceBroker() throws PBFactoryException
       {
  +        /*
  +        arminw:
  +        When running concurrent thread tests some times I got ConcurrentModificationException
  +        when SessionCache push objects to application cache. I assume that different threads
  +        lookup the same PB instance (maybe when the PB-pool creates a new PB instance),
thus
  +        synchronize this method may help.
  +        */
           if (log.isDebugEnabled()) log.debug("Obtain broker from pool for key " + getConfiguration().getKey());
           PersistenceBrokerInternal broker = null;
   
  
  
  

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