geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [16/24] geode git commit: GEODE-2301: Deprecate JTA transaction manager from Geode
Date Mon, 19 Jun 2017 15:23:49 GMT
GEODE-2301: Deprecate JTA transaction manager from Geode

Geode JTA transaction manager is deprecated and a warning message is logged if it is being
used.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/a21c9711
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/a21c9711
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/a21c9711

Branch: refs/heads/feature/GEODE-3071
Commit: a21c97111a288ac0a0986bb30545f1aacbec5880
Parents: a79d2cc
Author: eshu <eshu@pivotal.io>
Authored: Thu Jun 15 08:42:49 2017 -0700
Committer: eshu <eshu@pivotal.io>
Committed: Thu Jun 15 08:44:36 2017 -0700

----------------------------------------------------------------------
 .../apache/geode/internal/jta/GlobalTransaction.java |  4 ++++
 .../apache/geode/internal/jta/TransactionImpl.java   |  3 +++
 .../geode/internal/jta/TransactionManagerImpl.java   | 15 +++++++++++++++
 .../geode/internal/jta/UserTransactionImpl.java      |  4 ++++
 .../java/org/apache/geode/internal/jta/XidImpl.java  |  4 ++++
 5 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/a21c9711/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java
b/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java
index 03eeb20..4444d6f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java
@@ -21,6 +21,9 @@ package org.apache.geode.internal.jta;
  * 
  * 
  * @since GemFire 4.0
+ * 
+ * @deprecated as of Geode 1.2.0 user should use a third party JTA transaction manager to
manage JTA
+ *             transactions.
  */
 import org.apache.geode.i18n.LogWriterI18n;
 import org.apache.geode.internal.i18n.LocalizedStrings;
@@ -32,6 +35,7 @@ import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 
+@Deprecated
 public class GlobalTransaction {
 
   public static boolean DISABLE_TRANSACTION_TIMEOUT_SETTING = false;

http://git-wip-us.apache.org/repos/asf/geode/blob/a21c9711/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java b/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java
index a5e80b6..3279abe 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java
@@ -17,6 +17,8 @@ package org.apache.geode.internal.jta;
 /**
  * TransactionImpl implements the JTA Transaction interface.
  * 
+ * @deprecated as of Geode 1.2.0 user should use a third party JTA transaction manager to
manage JTA
+ *             transactions.
  */
 import javax.transaction.xa.*;
 import javax.transaction.*;
@@ -26,6 +28,7 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
 
 import java.util.*;
 
+@Deprecated
 public class TransactionImpl implements Transaction {
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/a21c9711/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
b/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
index 15ab1f8..b7a60b8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
@@ -20,6 +20,8 @@ package org.apache.geode.internal.jta;
  * </p>
  * 
  * @since GemFire 4.1.1
+ * 
+ * @deprecated as of Geode 1.2.0 user should use a third party JTA transaction manager instead.
  */
 import java.io.Serializable;
 import java.util.Collections;
@@ -31,6 +33,7 @@ import java.util.Map;
 import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.transaction.HeuristicMixedException;
 import javax.transaction.HeuristicRollbackException;
@@ -42,14 +45,19 @@ import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.CancelException;
 import org.apache.geode.i18n.LogWriterI18n;
 import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.LoggingThreadGroup;
 
+@Deprecated
 public class TransactionManagerImpl implements TransactionManager, Serializable {
   private static final long serialVersionUID = 5033392316185449821L;
 
+  private static final Logger logger = LogService.getLogger();
   /**
    * A mapping of Thread - Transaction Objects
    */
@@ -99,6 +107,9 @@ public class TransactionManagerImpl implements TransactionManager, Serializable
    */
   private boolean isActive = true;
 
+  transient private final AtomicBoolean loggedJTATransactionManagerDeprecatedWarning =
+      new AtomicBoolean(false);
+
   /**
    * Constructs a new TransactionManagerImpl
    */
@@ -143,6 +154,10 @@ public class TransactionManagerImpl implements TransactionManager, Serializable
    * @see javax.transaction.TransactionManager#begin()
    */
   public void begin() throws NotSupportedException, SystemException {
+    if (loggedJTATransactionManagerDeprecatedWarning.compareAndSet(false, true)) {
+      logger.warn(
+          "Geode JTA transaction manager is deprecated since 1.2.0, please use a third party
JTA transaction manager instead");
+    }
     if (!isActive) {
       throw new SystemException(
           LocalizedStrings.TransactionManagerImpl_TRANSACTIONMANAGER_INVALID.toLocalizedString());

http://git-wip-us.apache.org/repos/asf/geode/blob/a21c9711/geode-core/src/main/java/org/apache/geode/internal/jta/UserTransactionImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/jta/UserTransactionImpl.java
b/geode-core/src/main/java/org/apache/geode/internal/jta/UserTransactionImpl.java
index 2471e02..2f287d4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/jta/UserTransactionImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/jta/UserTransactionImpl.java
@@ -23,6 +23,9 @@ package org.apache.geode.internal.jta;
  * 
  * 
  * @since GemFire 4.0
+ * 
+ * @deprecated as of Geode 1.2.0 user should use a third party JTA transaction manager to
manage JTA
+ *             transactions.
  */
 import java.io.Serializable;
 import javax.transaction.*;
@@ -31,6 +34,7 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.i18n.LogWriterI18n;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
+@Deprecated
 public class UserTransactionImpl implements UserTransaction, Serializable {
   private static final long serialVersionUID = 2994652455204901910L;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/a21c9711/geode-core/src/main/java/org/apache/geode/internal/jta/XidImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/jta/XidImpl.java b/geode-core/src/main/java/org/apache/geode/internal/jta/XidImpl.java
index 865f0aa..7f093fb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/jta/XidImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/jta/XidImpl.java
@@ -20,9 +20,13 @@ package org.apache.geode.internal.jta;
  * </p>
  * 
  * @since GemFire 4.0
+ * 
+ * @deprecated as of Geode 1.2.0 user should use a third party JTA transaction manager to
manage JTA
+ *             transactions.
  */
 import javax.transaction.xa.*;
 
+@Deprecated
 public class XidImpl implements Xid {
 
   /**


Mime
View raw message