db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/odmg TransactionImpl.java
Date Sat, 14 Dec 2002 15:01:58 GMT
arminw      2002/12/14 07:01:58

  Modified:    src/java/org/apache/ojb/odmg TransactionImpl.java
  Log:
  fix bug in #lock(...) method caused by
  'acceptLocks' part.
  
  Revision  Changes    Path
  1.30      +15 -17    jakarta-ojb/src/java/org/apache/ojb/odmg/TransactionImpl.java
  
  Index: TransactionImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/odmg/TransactionImpl.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- TransactionImpl.java	9 Dec 2002 22:00:10 -0000	1.29
  +++ TransactionImpl.java	14 Dec 2002 15:01:57 -0000	1.30
  @@ -236,25 +236,23 @@
        */
       public void lock(Object obj, int lockMode) throws LockNotGrantedException
       {
  -        ClassDescriptor cld = this.getBroker().getClassDescriptor(obj.getClass());
  -        if (!cld.isAcceptLocks())
  -        {
  -        		if (log.isDebugEnabled())
  -                 log.debug("skipping lock on class: " + cld.getClassNameOfObject() + "
object " + obj.toString());
  -            return;
  -        }
  -        else
  -        {
  -            if (log.isDebugEnabled())
  -                log.debug("proceeding with lock on class: " + cld.getClassNameOfObject()
+ " object " + obj.toString());
  -        }
  -    	
           if (log.isDebugEnabled()) log.debug("lock object was called on tx " + this);
           checkOpen();
   
  -        //first assign all foreign keys for non-proxies/virtualproxy
  -        if (!(obj instanceof Proxy) && !(obj instanceof VirtualProxy))
  +        if (!(obj instanceof VirtualProxy) && !(obj instanceof Proxy))
           {
  +            ClassDescriptor cld = this.getBroker().getClassDescriptor(obj.getClass());
  +            if (!cld.isAcceptLocks())
  +            {
  +                    if (log.isDebugEnabled())
  +                     log.debug("skipping lock on class: " + cld.getClassNameOfObject()
+ " object " + obj.toString());
  +                return;
  +            }
  +            else
  +            {
  +                if (log.isDebugEnabled())
  +                    log.debug("proceeding with lock on class: " + cld.getClassNameOfObject()
+ " object " + obj.toString());
  +            }
               assignReferenceFKs(
                       obj,
                       this.getBroker().getClassDescriptor(obj.getClass()).getObjectReferenceDescriptors());
  @@ -320,7 +318,7 @@
               item = (ObjectEnvelope) enum.nextElement();
               item.beforeCommit();
           }
  -        
  +
           // Now perfom the real work
           objectEnvelopeTable.commit();
   
  
  
  

Mime
View raw message