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/accesslayer/batch BatchManagerImpl.java
Date Sat, 18 Sep 2004 17:36:32 GMT
arminw      2004/09/18 10:36:32

  Modified:    src/java/org/apache/ojb/broker/accesslayer/batch
                        BatchManagerImpl.java
  Log:
  change order of checks
  
  Revision  Changes    Path
  1.2       +19 -8     db-ojb/src/java/org/apache/ojb/broker/accesslayer/batch/BatchManagerImpl.java
  
  Index: BatchManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/batch/BatchManagerImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BatchManagerImpl.java	14 Sep 2004 16:03:31 -0000	1.1
  +++ BatchManagerImpl.java	18 Sep 2004 17:36:32 -0000	1.2
  @@ -302,17 +302,28 @@
        */
       private boolean isBatchableAndCheckOptimisticLockingExecute(ClassDescriptor cld)
       {
  -        if (!includeOptimisticLocking && cld.isLocking())
  +        boolean result = false;
  +        // first we check if we are in batch mode
  +        if(broker.isInTransaction() && broker.serviceConnectionManager().isBatchMode())
           {
  -            if(cld.isBatchable())
  +            // if object use optimistic locking and we don't want
  +            // include those objects in batch
  +            if (!includeOptimisticLocking && cld.isLocking())
               {
  -                executeBatch();
  +                // if object is batchable we automatic handle the
  +                // batch and execute batch, else user is responsible for doing this
  +                if(cld.isBatchable())
  +                {
  +                    executeBatch();
  +                }
  +                result = false;
  +            }
  +            else if(cld.isBatchable())
  +            {
  +                result = true;
               }
  -            return false;
           }
  -        return broker.isInTransaction()
  -                && broker.serviceConnectionManager().isBatchMode()
  -                && cld.isBatchable();
  +        return result;
       }
   
       /**
  
  
  

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