arminw      2005/06/22 10:29:36

  Modified:    src/java/org/apache/ojb/odmg Tag: OJB_1_0_RELEASE
                        NarrowTransaction.java TransactionExt.java
                        TransactionImpl.java
  Log:
  (re-)add method to detect deleted objects within a running tx
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.10.2.6  +5 -0      
db-ojb/src/java/org/apache/ojb/odmg/NarrowTransaction.java
  
  Index: NarrowTransaction.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/odmg/NarrowTransaction.java,v
  retrieving revision 1.10.2.5
  retrieving revision 1.10.2.6
  diff -u -r1.10.2.5 -r1.10.2.6
  --- NarrowTransaction.java    4 Jun 2005 14:38:13 -0000       1.10.2.5
  +++ NarrowTransaction.java    22 Jun 2005 17:29:36 -0000      1.10.2.6
  @@ -194,4 +194,9 @@
       {
           tx.setNoteUserOrder(noteUserOrder);
       }
  +
  +    public boolean isDeleted(Identity id)
  +    {
  +        return tx.isDeleted(id);
  +    }
   }
  
  
  
  1.4.2.5   +12 -1     db-ojb/src/java/org/apache/ojb/odmg/TransactionExt.java
  
  Index: TransactionExt.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/TransactionExt.java,v
  retrieving revision 1.4.2.4
  retrieving revision 1.4.2.5
  diff -u -r1.4.2.4 -r1.4.2.5
  --- TransactionExt.java       4 Jun 2005 14:38:13 -0000       1.4.2.4
  +++ TransactionExt.java       22 Jun 2005 17:29:36 -0000      1.4.2.5
  @@ -1,6 +1,7 @@
   package org.apache.ojb.odmg;
   
   import org.odmg.Transaction;
  +import org.apache.ojb.broker.Identity;
   
   /* Copyright 2003-2004 The Apache Software Foundation
    *
  @@ -155,4 +156,14 @@
        * @see ImplementationExt#setNoteUserOrder(boolean) 
        */
       public void setNoteUserOrder(boolean noteUserOrder);
  +
  +    /**
  +     * Checks if the object with the given [EMAIL PROTECTED] 
org.apache.ojb.broker.Identity}
  +     * has been deleted within the transaction using
  +     * [EMAIL PROTECTED] org.odmg.Database#deletePersistent(Object)} or 
[EMAIL PROTECTED] #markDelete(Object)}.
  +     *
  +     * @param id The identity of the object.
  +     * @return <em>true</em> if the object has been deleted within the 
transaction.
  +     */
  +    public boolean isDeleted(Identity id);
   }
  
  
  
  1.59.2.19 +10 -1     db-ojb/src/java/org/apache/ojb/odmg/TransactionImpl.java
  
  Index: TransactionImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/TransactionImpl.java,v
  retrieving revision 1.59.2.18
  retrieving revision 1.59.2.19
  diff -u -r1.59.2.18 -r1.59.2.19
  --- TransactionImpl.java      14 Jun 2005 13:29:42 -0000      1.59.2.18
  +++ TransactionImpl.java      22 Jun 2005 17:29:36 -0000      1.59.2.19
  @@ -619,6 +619,15 @@
       }
   
       /**
  +     * @see 
org.apache.ojb.odmg.TransactionExt#isDeleted(org.apache.ojb.broker.Identity)
  +     */
  +    public boolean isDeleted(Identity id)
  +    {
  +        ObjectEnvelope envelope = objectEnvelopeTable.getByIdentity(id);
  +        return (envelope == null ? false : envelope.needsDelete());
  +    }
  +
  +    /**
        * Upgrade the lock on the given object to the given lock mode. Method 
<code>
        * tryLock</code> is the same as <code>lock</code> except it returns a 
boolean
        * indicating whether the lock was granted instead of generating an 
exception.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to