Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 50337 invoked from network); 18 Sep 2004 17:36:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Sep 2004 17:36:35 -0000 Received: (qmail 15227 invoked by uid 500); 18 Sep 2004 17:36:35 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 15019 invoked by uid 500); 18 Sep 2004 17:36:34 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 14999 invoked by uid 500); 18 Sep 2004 17:36:34 -0000 Received: (qmail 14996 invoked by uid 99); 18 Sep 2004 17:36:33 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 18 Sep 2004 10:36:33 -0700 Received: (qmail 50311 invoked by uid 1510); 18 Sep 2004 17:36:32 -0000 Date: 18 Sep 2004 17:36:32 -0000 Message-ID: <20040918173632.50310.qmail@minotaur.apache.org> From: arminw@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer/batch BatchManagerImpl.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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