db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/singlevm PersistenceBrokerImpl.java
Date Thu, 06 Feb 2003 17:42:12 GMT
brj         2003/02/06 09:42:12

  Modified:    src/java/org/apache/ojb/broker/singlevm
                        PersistenceBrokerImpl.java
  Log:
  removed mark_for_store
  
  Revision  Changes    Path
  1.126     +17 -54    db-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java
  
  Index: PersistenceBrokerImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- PersistenceBrokerImpl.java	5 Feb 2003 21:26:30 -0000	1.125
  +++ PersistenceBrokerImpl.java	6 Feb 2003 17:42:11 -0000	1.126
  @@ -173,7 +173,6 @@
   	 * Maps for object registration during store and delete operations. We reuse these maps
to avoid excessive object
   	 * creation.
   	 */
  -	private Map m_markedForStore;
   	private Map m_markedForDelete;
   
       protected PersistenceBrokerImpl()
  @@ -1681,38 +1680,7 @@
   
           if (obj != null)
           {
  -            /**
  -             * MBAIRD
  -             * 1. if we are marked for store already, avoid recursing on this object
  -             * do this AFTER we check if it's a proxy and it's materialized otherwise we
will
  -             * materialize the proxy by putting it in the map.
  -             */
  -			if (m_markedForStore != null)
  -			{
  -				if (m_markedForStore.containsKey(obj))
  -				{
  -					Boolean insertUpdateMarker = (Boolean) m_markedForStore.get(obj);
  -                    // BRJ : avoid multiple insert
  -                    if (insert == true && insertUpdateMarker.booleanValue() ==
insert) 
  -					{
  -						return;
  -					}
  -				}
  -			}
  -			else
  -			{
  -				/**
  -				 * optimization: only initialize when we need to.
  -				 */
  -				m_markedForStore = new HashMap();
  -			}
  -
  -            /**
  -             * MBAIRD
  -             * 2. register object in markedForStore map with proper marker (insert flag)
  -             */
  -            m_markedForStore.put(obj, new Boolean(insert));
  -            storeToDb(obj, cld, oid, m_markedForStore, insert);
  +            storeToDb(obj, cld, oid, insert);
           }
           else
           {
  @@ -1728,10 +1696,9 @@
        * @param obj
        * @param cld
        * @param oid
  -     * @param markedForStore
        * @param insert
        */
  -    private void storeToDb(Object obj, ClassDescriptor cld, Identity oid, Map markedForStore,
boolean insert)
  +    private void storeToDb(Object obj, ClassDescriptor cld, Identity oid, boolean insert)
       {
           /**
            * only do the update/insert if all PK values are either defined as
  @@ -1764,7 +1731,7 @@
                * 2. go down through heirarchy until current class
                * 3. todo: store to full extent?
                 */
  -            storeSuperClasses(obj, cld, oid, markedForStore, insert);
  +            storeSuperClasses(obj, cld, oid, insert);
   
   
   
  @@ -1870,14 +1837,14 @@
        * @param obj
        * @param cld
        */
  -    private void storeSuperClasses(Object obj, ClassDescriptor cld, Identity oid, Map markedForStore,
boolean insert)
  +    private void storeSuperClasses(Object obj, ClassDescriptor cld, Identity oid, boolean
insert)
       {
           // get super class cld then store it with the object
           if(cld.getSuperClass() != null)
           {
   
               ClassDescriptor superCld = getDescriptorRepository().getDescriptorFor(cld.getSuperClass());
  -            storeToDb(obj, superCld, oid, markedForStore, insert);
  +            storeToDb(obj, superCld, oid, insert);
   
                // get id for super class to store in this subclass
               /*FieldDescriptor superIdField = superCld.getPrimaryKey();
  @@ -2287,7 +2254,16 @@
       }
   
   
  -
  +    /**
  +     * clean up the maps for reuse by the next transaction.
  +     */
  +    private void clearRegistrationMaps()
  +    {
  +        if (m_markedForDelete != null)
  +        {
  +            m_markedForDelete.clear();
  +        }
  +    }
   
   // ************************************************************************
   // inner class
  @@ -2348,18 +2324,5 @@
           }
       }
   
  -	/**
  -	 * clean up the maps for reuse by the next transaction.
  -	 */
  -	private void clearRegistrationMaps()
  -	{
  -		if (m_markedForDelete != null)
  -		{
  -			m_markedForDelete.clear();
  -		}
  -		if (m_markedForStore != null)
  -		{
  -			m_markedForStore.clear();
  -		}
  -	}
  +
   }
  
  
  

Mime
View raw message