db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r420914 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java
Date Tue, 11 Jul 2006 16:25:27 GMT
Author: arminw
Date: Tue Jul 11 09:25:25 2006
New Revision: 420914

URL: http://svn.apache.org/viewvc?rev=420914&view=rev
Log:
minor code cleanup

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

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java?rev=420914&r1=420913&r2=420914&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHighLowImpl.java
Tue Jul 11 09:25:25 2006
@@ -123,6 +123,7 @@
     public static final String PROPERTY_GRAB_SIZE = "grabSize";
     public static final String PROPERTY_GLOBAL_SEQUENCE_ID = "globalSequenceId";
     public static final String PROPERTY_GLOBAL_SEQUENCE_START = "globalSequenceStart";
+    private static final Object sync = new Object();
 
     protected static Map sequencesDBMap = new HashMap();
 
@@ -150,7 +151,7 @@
     {
         HighLowSequence seq;
         String sequenceName = buildSequenceName(field);
-        synchronized (SequenceManagerHighLowImpl.class)
+        synchronized (sync)
         {
             // try to find sequence
             seq = getSequence(sequenceName);
@@ -220,9 +221,9 @@
         if(mapForDB == null)
         {
             mapForDB = new HashMap();
+            sequencesDBMap.put(jcdAlias, mapForDB);
         }
         mapForDB.put(sequenceName, seq);
-        sequencesDBMap.put(jcdAlias, mapForDB);
     }
 
     /**
@@ -237,7 +238,7 @@
                 .serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
         if(mapForDB != null)
         {
-            synchronized(SequenceManagerHighLowImpl.class)
+            synchronized(sync)
             {
                 mapForDB.remove(sequenceName);
             }



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