db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/odmg TransactionExt.java TransactionImpl.java OJB.java NarrowTransaction.java
Date Fri, 03 Oct 2003 12:39:40 GMT
thma        2003/10/03 05:39:40

  Modified:    src/java/org/apache/ojb/odmg TransactionExt.java
                        TransactionImpl.java OJB.java
                        NarrowTransaction.java
  Log:
  add Phil Warricks idea to allow to modify the implicit locking behaviour at runtime
  
  Revision  Changes    Path
  1.2       +13 -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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TransactionExt.java	29 Jul 2003 16:52:37 -0000	1.1
  +++ TransactionExt.java	3 Oct 2003 12:39:40 -0000	1.2
  @@ -41,4 +41,16 @@
        * This method is very similair to {@link org.odmg.Transaction#checkpoint}.
        */
       public void flush();
  +    
  +    
  +    /**
  +     * This method can be used to activate or deactivate the implicit
  +     * locking mechanism for the current transaction.
  +     * turning of implicit locking may improve performance but requires
  +     * additional care to make sure all changed objects are properly
  +     * registered to the transaction.
  +     * @param value if set to true implicit locking is enabled, 
  +     *        if false, implicit locking is disabled.
  +     **/
  +    public void setImplicitLocking(boolean value);
   }
  
  
  
  1.46      +9 -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.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- TransactionImpl.java	29 Jul 2003 16:53:24 -0000	1.45
  +++ TransactionImpl.java	3 Oct 2003 12:39:40 -0000	1.46
  @@ -1212,4 +1212,12 @@
           useWriteLocks = odmgConfig.lockAssociationAsWrites();
           useImplicitLocking = odmgConfig.useImplicitLocking();
       }
  +    /**
  +     * @see org.apache.ojb.odmg.TransactionExt#setImplicitLocking(boolean)
  +     */
  +    public synchronized void setImplicitLocking(boolean value)
  +    {
  +    	useImplicitLocking = value;
  +    }
  +
   }
  
  
  
  1.14      +17 -1     db-ojb/src/java/org/apache/ojb/odmg/OJB.java
  
  Index: OJB.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/OJB.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- OJB.java	6 Aug 2003 00:20:13 -0000	1.13
  +++ OJB.java	3 Oct 2003 12:39:40 -0000	1.14
  @@ -359,4 +359,20 @@
           setCurrentDatabase(newDB);
           usedDatabases.add(newDB.getPBKey());
       }
  +
  +    /**
  +     * This method can be used to activate or deactivate the implicit
  +     * locking mechanism for the current transaction.
  +     * turning of implicit locking may improve performance but requires
  +     * additional care to make sure all changed objects are properly
  +     * registered to the transaction.
  +     * @param value if set to true implicit locking is enabled, 
  +     *        if false, implicit locking is disabled.
  +     **/    
  +	public void setImplicitLocking(boolean value)
  +	{
  +		((TransactionExt)currentTransaction()).setImplicitLocking(value);
  +	}
  +
  +    
   }
  
  
  
  1.6       +8 -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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NarrowTransaction.java	10 Aug 2003 09:53:13 -0000	1.5
  +++ NarrowTransaction.java	3 Oct 2003 12:39:40 -0000	1.6
  @@ -127,4 +127,12 @@
   	{
   		return ((TransactionImpl)tx).getObjectByIdentity(id);
   	}
  +    /**
  +     * @see org.apache.ojb.odmg.TransactionExt#setImplicitLocking(boolean)
  +     */
  +    public void setImplicitLocking(boolean value)
  +    {
  +    	tx.setImplicitLocking(value);
  +    }
  +
   }
  
  
  

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