activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject git commit: ignore transacted and ack mode in the rar - closer to jms 2.0 semantics and fixes tck cached connection issues. in the absense of a transaction their will never be a commit so using a local transaction is totally broken. transactions come fro
Date Fri, 14 Mar 2014 23:27:34 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 4e79e4390 -> adb49f562


ignore transacted and ack mode in the rar - closer to jms 2.0 semantics and fixes tck cached
connection issues. in the absense of a transaction their will never be a commit so using a
local transaction is totally broken. transactions come from rar local or xa or none


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

Branch: refs/heads/trunk
Commit: adb49f562725087865ded9a773ee6901423c870b
Parents: 4e79e43
Author: gtully <gary.tully@gmail.com>
Authored: Fri Mar 14 23:24:33 2014 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Fri Mar 14 23:26:08 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/activemq/ra/ManagedConnectionProxy.java     | 5 +----
 .../org/apache/activemq/ra/ManagedConnectionFactoryTest.java    | 4 ++++
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/adb49f56/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedConnectionProxy.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedConnectionProxy.java
b/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedConnectionProxy.java
index c4dc8d7..7d5035c 100755
--- a/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedConnectionProxy.java
+++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedConnectionProxy.java
@@ -112,10 +112,7 @@ public class ManagedConnectionProxy implements Connection, QueueConnection,
Topi
      * @throws JMSException on error
      */
     private ManagedSessionProxy createSessionProxy(boolean transacted, int acknowledgeMode)
throws JMSException {
-        if (!transacted && acknowledgeMode == Session.SESSION_TRANSACTED) {
-            acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
-        }
-        ActiveMQSession session = (ActiveMQSession) getConnection().createSession(transacted,
acknowledgeMode);
+        ActiveMQSession session = (ActiveMQSession) getConnection().createSession(false,
Session.AUTO_ACKNOWLEDGE);
         ManagedTransactionContext txContext = new ManagedTransactionContext(managedConnection.getTransactionContext());
         session.setTransactionContext(txContext);
         ManagedSessionProxy p = new ManagedSessionProxy(session, this);

http://git-wip-us.apache.org/repos/asf/activemq/blob/adb49f56/activemq-ra/src/test/java/org/apache/activemq/ra/ManagedConnectionFactoryTest.java
----------------------------------------------------------------------
diff --git a/activemq-ra/src/test/java/org/apache/activemq/ra/ManagedConnectionFactoryTest.java
b/activemq-ra/src/test/java/org/apache/activemq/ra/ManagedConnectionFactoryTest.java
index 1eb003b..99e1213 100755
--- a/activemq-ra/src/test/java/org/apache/activemq/ra/ManagedConnectionFactoryTest.java
+++ b/activemq-ra/src/test/java/org/apache/activemq/ra/ManagedConnectionFactoryTest.java
@@ -28,6 +28,7 @@ import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
 import javax.jms.QueueConnectionFactory;
+import javax.jms.Session;
 import javax.jms.TopicConnectionFactory;
 import javax.resource.Referenceable;
 import javax.resource.ResourceException;
@@ -88,6 +89,9 @@ public class ManagedConnectionFactoryTest extends TestCase {
         assertTrue(connection != null);
         assertTrue(connection instanceof ManagedConnectionProxy);
 
+        Session session = connection.createSession(true, 0);
+        assertFalse("transacted attribute is ignored, only transacted with xa or local tx",
session.getTransacted());
+
         connection.close();
 
     }


Mime
View raw message