db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r369616 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java
Date Tue, 17 Jan 2006 00:36:01 GMT
Author: arminw
Date: Mon Jan 16 16:35:57 2006
New Revision: 369616

URL: http://svn.apache.org/viewcvs?rev=369616&view=rev
Log:
use negative values for transient sequence id's

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java?rev=369616&r1=369615&r2=369616&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerTransientImpl.java
Mon Jan 16 16:35:57 2006
@@ -31,7 +31,7 @@
      Use keyword 'volatile' to make decrement of a long value an
      atomic operation
      */
-    private static volatile long tempKey = 1000;
+    private static volatile long tempKey = -1000;
 
     public SequenceManagerTransientImpl(PersistenceBroker broker)
     {
@@ -43,8 +43,8 @@
         /*
         arminw:
         We need unique 'dummy keys' for new objects before storing.
-        Variable 'tempKey' is declared volatile, thus increment should be atomic
+        Variable 'tempKey' is declared volatile, thus decrement should be atomic
         */
-        return ++tempKey;
+        return --tempKey;
     }
 }



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