Index: StompTest.java
===================================================================
--- StompTest.java	(revision 672730)
+++ StompTest.java	(working copy)
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.transport.stomp;
 
+import java.io.BufferedReader;
+import java.io.StringReader;
 import java.io.IOException;
 import java.net.Socket;
 import java.net.SocketTimeoutException;
@@ -856,7 +858,62 @@
         frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
         stompConnection.sendFrame(frame);    	
     }
-    
+
+	public void testOnRollbackReceiveTwoMessagesBug() throws Exception {
+
+        String frame = "CONNECT\n" + "login: system\n" + "passcode: manager\n\n" + Stomp.NULL;
+        stompConnection.sendFrame(frame);
+		stompConnection.receiveFrame();
+
+        frame = "SEND\n" + "destination:/queue/" + getQueueName() + "\n" + "\n\n" + "Message 1" + Stomp.NULL;
+        stompConnection.sendFrame(frame);
+
+        frame = "SEND\n" + "destination:/queue/" + getQueueName() + "\n" + "\n\n" + "Message 2" + Stomp.NULL;
+        stompConnection.sendFrame(frame);
+
+        frame = "SEND\n" + "destination:/queue/" + getQueueName() + "\n" + "\n\n" + "Message 3" + Stomp.NULL;
+        stompConnection.sendFrame(frame);
+
+        waitForFrameToTakeEffect();
+	
+        frame = "SUBSCRIBE\n" + "destination:/queue/" + getQueueName() + "\n" + "ack:client\n\n" + Stomp.NULL;
+        stompConnection.sendFrame(frame);
+
+        frame = stompConnection.receiveFrame();
+		BufferedReader br = new BufferedReader(new StringReader(frame));
+		String message_id = null;
+		String line = null;
+		while((line = br.readLine()) != null)
+		{
+			if (line.startsWith("message-id"))
+			{
+				message_id = line;
+				break;
+			}
+		}
+
+
+        frame = "BEGIN\n" + "transaction: tx1\n" + "\n\n" + Stomp.NULL;
+        stompConnection.sendFrame(frame);
+
+		frame = "ACK\n" + "transaction:tx1\n" + message_id + "\n\n" + Stomp.NULL;
+		stompConnection.sendFrame(frame);
+
+		String m2 = stompConnection.receiveFrame();
+		try
+		{
+			String m3 = stompConnection.receiveFrame(500);
+			fail("Should not have received second message");
+		}
+		catch(IOException e)
+		{
+		}
+
+        frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
+        stompConnection.sendFrame(frame);
+
+	}
+
     protected void assertClients(int expected) throws Exception {
         org.apache.activemq.broker.Connection[] clients = broker.getBroker().getClients();
         int actual = clients.length;
Index: StompConnection.java
===================================================================
--- StompConnection.java	(revision 672730)
+++ StompConnection.java	(working copy)
@@ -58,7 +58,7 @@
         return receiveFrame(RECEIVE_TIMEOUT);
     }
 
-    private String receiveFrame(long timeOut) throws Exception {
+    public String receiveFrame(long timeOut) throws Exception {
         stompSocket.setSoTimeout((int)timeOut);
         InputStream is = stompSocket.getInputStream();
         int c = 0;
