activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r694683 - in /activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store: KahaDBPersistenceAdaptor.java MessageDatabase.java
Date Fri, 12 Sep 2008 14:27:14 GMT
Author: chirino
Date: Fri Sep 12 07:27:13 2008
New Revision: 694683

URL: http://svn.apache.org/viewvc?rev=694683&view=rev
Log:
Always sync transactions to disk.

Modified:
    activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/KahaDBPersistenceAdaptor.java
    activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java

Modified: activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/KahaDBPersistenceAdaptor.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/KahaDBPersistenceAdaptor.java?rev=694683&r1=694682&r2=694683&view=diff
==============================================================================
--- activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/KahaDBPersistenceAdaptor.java
(original)
+++ activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/KahaDBPersistenceAdaptor.java
Fri Sep 12 07:27:13 2008
@@ -140,7 +140,7 @@
             ByteSequence packet = wireFormat.marshal(message);
             command.setMessage(ByteString.copyFrom(packet.getData(), packet.getOffset(),
packet.getLength()));
 
-            store(command, message.isResponseRequired());
+            store(command, isSyncWrites() && message.isResponseRequired());
             
         }
         
@@ -149,7 +149,7 @@
             command.setDestination(dest);
             command.setMessageId(ack.getLastMessageId().toString());
             command.setTransactionInfo(createTransactionInfo(ack.getTransactionId()) );
-            store(command, ack.isResponseRequired());
+            store(command, isSyncWrites() && ack.isResponseRequired());
         }
 
         public void removeAllMessages(ConnectionContext context) throws IOException {
@@ -265,7 +265,7 @@
             // Looks like a design issue with the TopicMessageStore interface.  Also we can't
recover the original ack
             // to pass back to the XA recover method.
             // command.setTransactionInfo();
-            store(command, true);
+            store(command, false);
         }
 
         public void addSubsciption(SubscriptionInfo subscriptionInfo, boolean retroactive)
throws IOException {
@@ -276,14 +276,14 @@
             command.setRetroactive(retroactive);
             ByteSequence packet = wireFormat.marshal(subscriptionInfo);
             command.setSubscriptionInfo(ByteString.copyFrom(packet.getData(), packet.getOffset(),
packet.getLength()));
-            store(command, true);
+            store(command, isSyncWrites() && true);
         }
 
         public void deleteSubscription(String clientId, String subscriptionName) throws IOException
{
             KahaSubscriptionCommand command = new KahaSubscriptionCommand();
             command.setDestination(dest);
             command.setSubscriptionKey(subscriptionKey(clientId, subscriptionName));
-            store(command, true);
+            store(command, isSyncWrites() && true);
         }
 
         public SubscriptionInfo[] getAllSubscriptions() throws IOException {

Modified: activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java?rev=694683&r1=694682&r2=694683&view=diff
==============================================================================
--- activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java (original)
+++ activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java Fri
Sep 12 07:27:13 2008
@@ -395,7 +395,7 @@
         DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1);
         os.writeByte(data.type().getNumber());
         data.writeTo(os);
-        Location location = asyncDataManager.write(os.getByteSequence(), syncWrites &&
sync);
+        Location location = asyncDataManager.write(os.getByteSequence(), sync);
         process(data, location);
         if( !recovering ) {
             metadata.lastUpdate = location;



Mime
View raw message