You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by sa...@apache.org on 2015/06/18 14:03:04 UTC
ode git commit: ODE-1033: reverted the changes
Repository: ode
Updated Branches:
refs/heads/ode-1.3.x 99d70ed56 -> ee890b452
ODE-1033: reverted the changes
Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/ee890b45
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/ee890b45
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/ee890b45
Branch: refs/heads/ode-1.3.x
Commit: ee890b452c6bce39f7911f06be29e8825e8aca20
Parents: 99d70ed
Author: sathwik <sa...@apache.org>
Authored: Thu Jun 18 17:32:39 2015 +0530
Committer: sathwik <sa...@apache.org>
Committed: Thu Jun 18 17:32:39 2015 +0530
----------------------------------------------------------------------
.../org/apache/ode/store/ProcessStoreImpl.java | 48 ++++----------------
1 file changed, 8 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ode/blob/ee890b45/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
----------------------------------------------------------------------
diff --git a/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java b/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
index 2e09bde..138336c 100644
--- a/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
+++ b/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
@@ -42,7 +42,6 @@ import java.io.IOException;
import java.sql.SQLException;
import java.util.*;
import java.util.concurrent.*;
-import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.regex.Matcher;
@@ -103,7 +102,7 @@ public class ProcessStoreImpl implements ProcessStore {
*/
private DataSource _inMemDs;
- private AtomicLong _version = new AtomicLong(0);
+
public ProcessStoreImpl() {
this(null, null, "", new OdeConfigProperties(new Properties(), ""), true);
@@ -131,46 +130,9 @@ public class ProcessStoreImpl implements ProcessStore {
_inMemDs = hsqlds;
}
- initializeVersionCounter();
- }
-
- /**
- * Process and DU use a monotonically increased single version number by default.
- * Reads the version number from the database and intializes the version counter which
- * is used to assign version numbers to Deployment units and Processes. Version counter is an atomic long object.
- * Cluster implementations need to provide a cluster wide version counter.
- * Version counter is initialized in the constructor.
- */
- protected void initializeVersionCounter(){
-
- long version = readNextVersionFromDB();
- _version.compareAndSet(0, version);
}
- /**
- * Reads the monotonic version number from the database.
- * @return incremented value of version.
- */
- protected long readNextVersionFromDB() {
- long version = exec(new Callable<Long>() {
- public Long call(ConfStoreConnection conn) {
- return conn.getNextVersion();
- }
- });
-
- return version;
- }
-
- /**
- * Returns the current value of the version counter and increments.
- * Cluster implementations need to override this method.
- * @return Current value of the version counter.
- * @see #initializeVersionCounter()
- */
- protected long getAndIncrementVersion(){
- return _version.getAndIncrement();
- }
/**
* Constructor that hardwires OpenJPA on a new in-memory database. Suitable for tests.
@@ -233,7 +195,13 @@ public class ProcessStoreImpl implements ProcessStore {
long version;
if (autoincrementVersion || du.getStaticVersion() == -1) {
- version = getAndIncrementVersion();
+ // Process and DU use a monotonically increased single version number by default.
+ version = exec(new Callable<Long>() {
+ public Long call(ConfStoreConnection conn) {
+ return conn.getNextVersion();
+ }
+ });
+
} else {
version = du.getStaticVersion();
}