activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1482334 - in /activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc: JDBCMessageStore.java JDBCPersistenceAdapter.java JdbcMemoryTransactionStore.java
Date Tue, 14 May 2013 13:49:10 GMT
Author: chirino
Date: Tue May 14 13:49:09 2013
New Revision: 1482334

URL: http://svn.apache.org/r1482334
Log:
Fixing regression introduced by AMQ-4529 the JdbcXARecoveryBrokerTest was failing.

Switching the jdbc store to use the entryLocator instead of the dataLocator

Modified:
    activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCMessageStore.java
    activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java
    activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JdbcMemoryTransactionStore.java

Modified: activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCMessageStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCMessageStore.java?rev=1482334&r1=1482333&r2=1482334&view=diff
==============================================================================
--- activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCMessageStore.java
(original)
+++ activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCMessageStore.java
Tue May 14 13:49:09 2013
@@ -129,7 +129,7 @@ public class JDBCMessageStore extends Ab
             c.close();
         }
         if (context != null && context.getXid() != null) {
-            message.getMessageId().setDataLocator(sequenceId);
+            message.getMessageId().setEntryLocator(sequenceId);
         } else {
             onAdd(messageId, sequenceId, message.getPriority());
         }
@@ -204,7 +204,7 @@ public class JDBCMessageStore extends Ab
             c.close();
         }
         if (context != null && context.getXid() != null) {
-            ack.getLastMessageId().setDataLocator(seq);
+            ack.getLastMessageId().setEntryLocator(seq);
         }
     }
 

Modified: activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java?rev=1482334&r1=1482333&r2=1482334&view=diff
==============================================================================
--- activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapter.java
Tue May 14 13:49:09 2013
@@ -737,7 +737,7 @@ public class JDBCPersistenceAdapter exte
     public void commitAdd(ConnectionContext context, MessageId messageId) throws IOException
{
         TransactionContext c = getTransactionContext(context);
         try {
-            long sequence = (Long)messageId.getDataLocator();
+            long sequence = (Long)messageId.getEntryLocator();
             getAdapter().doCommitAddOp(c, sequence);
         } catch (SQLException e) {
             JDBCPersistenceAdapter.log("JDBC Failure: ", e);
@@ -750,7 +750,7 @@ public class JDBCPersistenceAdapter exte
     public void commitRemove(ConnectionContext context, MessageAck ack) throws IOException
{
         TransactionContext c = getTransactionContext(context);
         try {
-            getAdapter().doRemoveMessage(c, (Long)ack.getLastMessageId().getDataLocator(),
null);
+            getAdapter().doRemoveMessage(c, (Long)ack.getLastMessageId().getEntryLocator(),
null);
         } catch (SQLException e) {
             JDBCPersistenceAdapter.log("JDBC Failure: ", e);
             throw IOExceptionSupport.create("Failed to commit last ack: " + ack + ". Reason:
" + e,e);

Modified: activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JdbcMemoryTransactionStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JdbcMemoryTransactionStore.java?rev=1482334&r1=1482333&r2=1482334&view=diff
==============================================================================
--- activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JdbcMemoryTransactionStore.java
(original)
+++ activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/JdbcMemoryTransactionStore.java
Tue May 14 13:49:09 2013
@@ -106,7 +106,7 @@ public class JdbcMemoryTransactionStore 
                     jdbcPersistenceAdapter.commitAdd(context, message.getMessageId());
                     ((JDBCMessageStore)addMessageCommand.getMessageStore()).onAdd(
                             message.getMessageId(),
-                            (Long)message.getMessageId().getDataLocator(),
+                            (Long)message.getMessageId().getEntryLocator(),
                             message.getPriority());
 
                 }
@@ -163,7 +163,7 @@ public class JdbcMemoryTransactionStore 
 
     public void recoverAdd(long id, byte[] messageBytes) throws IOException {
         final Message message = (Message) ((JDBCPersistenceAdapter)persistenceAdapter).getWireFormat().unmarshal(new
ByteSequence(messageBytes));
-        message.getMessageId().setDataLocator(id);
+        message.getMessageId().setEntryLocator(id);
         Tx tx = getPreparedTx(message.getTransactionId());
         tx.add(new AddMessageCommand() {
             @Override
@@ -186,7 +186,7 @@ public class JdbcMemoryTransactionStore 
 
     public void recoverAck(long id, byte[] xid, byte[] message) throws IOException {
         Message msg = (Message) ((JDBCPersistenceAdapter)persistenceAdapter).getWireFormat().unmarshal(new
ByteSequence(message));
-        msg.getMessageId().setDataLocator(id);
+        msg.getMessageId().setEntryLocator(id);
         Tx tx = getPreparedTx(new XATransactionId(xid));
         final MessageAck ack = new MessageAck(msg, MessageAck.STANDARD_ACK_TYPE, 1);
         tx.add(new RemoveMessageCommand() {



Mime
View raw message