[jboss-cvs] JBoss Messaging SVN: r1693 - in branches/Branch_1_0: docs docs/examples/ejb3mdb docs/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb src/main/org/jboss/jms/client/remoting src/main/org/jboss/jms/server/endpoint src/main/org/jboss/messaging/core src/main/org/jboss/messaging/core/plugin tests/smoke tests/src/org/jboss/test/messaging/core/paging tests/src/org/jboss/test/messaging/jms tests/src/org/jboss/test/messaging/jms/stress util

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Dec 3 03:36:24 EST 2006


Author: ovidiu.feodorov at jboss.com
Date: 2006-12-03 03:36:09 -0500 (Sun, 03 Dec 2006)
New Revision: 1693

Added:
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/stress/ConcurrentCloseStressTest.java
Modified:
   branches/Branch_1_0/docs/README.html
   branches/Branch_1_0/docs/examples/ejb3mdb/do-not-distribute.properties
   branches/Branch_1_0/docs/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/EJB3MDBExample.java
   branches/Branch_1_0/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java
   branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
   branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
   branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
   branches/Branch_1_0/src/main/org/jboss/messaging/core/ChannelSupport.java
   branches/Branch_1_0/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java
   branches/Branch_1_0/tests/smoke/build.xml
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_2PCTest.java
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_NTTest.java
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_TTest.java
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_2PCTest.java
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_TTest.java
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/JMSTest.java
   branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/MessageConsumerTest.java
   branches/Branch_1_0/util/do-not-distribute.properties
Log:
merging 1.0.1.SP2 changes into Branch_1_0

Modified: branches/Branch_1_0/docs/README.html
===================================================================
--- branches/Branch_1_0/docs/README.html	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/docs/README.html	2006-12-03 08:36:09 UTC (rev 1693)
@@ -7,9 +7,9 @@
 </head>
 <body>
 <h1><br>
-JBoss Messaging 1.0.1.GA Release Notes</h1>
+JBoss Messaging 1.0.1.SP2 Release Notes</h1>
 <br>
-October 09, 2006<br>
+December 02, 2006<br>
 <br>
 <h2>Installation</h2>
 <br>
@@ -26,403 +26,32 @@
 <br>
 <br>
 <h2>Summary of Changes</h2>
-The <a
- href="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessaging101GAChanges">changes</a>
-introduced by this release are summarized in the JBoss Messaging
-Release History, available online <a
- href="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingReleaseHistory">here</a>.<br>
 <br>
+This is a bug fix release. It fixes a major concurrency bug (<a
+ href="http://jira.jboss.org/jira/browse/JBMESSAGING-660">JBMESSAGING-660</a>),
+and also adds some DLQ handling improvements.<br>
+<br>
 <h2>Release Notes </h2>
-<big>Includes versions: 1.0.1.CR1, 1.0.1.CR2, 1.0.1.CR3, 1.0.1.CR4,
-1.0.1.CR5, 1.0.1.GA</big>
+<big></big>
 <h3> </h3>
-<br>
-<h2 style="margin-left: 40px;">Feature Request</h2>
-<ul style="margin-left: 40px;">
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-294">JBMESSAGING-294</a>
-] Multiple Connectors (transports) per Server instance </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-296">JBMESSAGING-296</a>
-] Oracle PersistenceManager MBean configuration </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-345">JBMESSAGING-345</a>
-] Messaging should report it version in an INFO statement at boot </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-367">JBMESSAGING-367</a>
-] Upgrade JBossSerialization to GA version </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-476">JBMESSAGING-476</a>
-] Reoccuring Consumer endpoint activation failed Error </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-528">JBMESSAGING-528</a>
-] Update user manual to include details on configuring remoting's
-serverBindAddress </li>
-</ul>
 <h2 style="margin-left: 40px;">Bug</h2>
 <ul style="margin-left: 40px;">
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-274">JBMESSAGING-274</a>
-] server redeployment fails under unclear circumstances </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-277">JBMESSAGING-277</a>
-] Setting remoting lease period to -1 breaks ASF </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-279">JBMESSAGING-279</a>
-] IllegalStateException on ConnectionEndpoint: Cannot find consumer <id>
-    </id></li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-290">JBMESSAGING-290</a>
-] ServiceContainer.stop does not function correctlly </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-292">JBMESSAGING-292</a>
-] Remoting Lease memory leak </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-305">JBMESSAGING-305</a>
-] The release script includes unnecessary libraries in the scoped
-messaging sar </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-308">JBMESSAGING-308</a>
-] Transaction mem leak </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-323">JBMESSAGING-323</a>
-] At undeployment, JBossManagedConnectionPool is stopped after
-ServerPeer, causing org.jboss.remoting.InvalidConfigurationException </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-325">JBMESSAGING-325</a>
-] Message selectors and subscriptions </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-333">JBMESSAGING-333</a>
-] ConnectionFactory deployment fails with "Exception setting attribute
-JNDIBindings / NullPointerException" on JBoss 4.0.2 and lower </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-334">JBMESSAGING-334</a>
-] The Connector fails to deploy in JBoss 4.0.1SP1 and lower due to
-obsolete org.jboss.util.propertyeditor.PropertyEditors dependency </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-335">JBMESSAGING-335</a>
-] Remoting deployment fails on JBoss 4.0.1 and lower because of
-SecurityAssociation obsolete dependency </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-336">JBMESSAGING-336</a>
-] The automated installation procedure fails for an installer-created
-JBoss 4.x instance. </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-337">JBMESSAGING-337</a>
-] PersistenceManager and ChannelMapper try to create the proxy to their
-TransactionManager dependency too early. </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-339">JBMESSAGING-339</a>
-] The MDB example fails with classloading problems on an
-installer-created 4.0.3SP1 </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-344">JBMESSAGING-344</a>
-] MDB example dies with "java.lang.UnsupportedOperationException:
-Destination not specified" on server </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-346">JBMESSAGING-346</a>
-] Spurious ConcurrentModificationException on connection failure </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-359">JBMESSAGING-359</a>
-] Using jboss-serialization 1.0.0.CR7 breaks functional testsuite </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-362">JBMESSAGING-362</a>
-] Remote stress test fails </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-363">JBMESSAGING-363</a>
-] TCK tests fail on account of wrong exception being thrown </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-364">JBMESSAGING-364</a>
-] TCK ee.mdb.xa.MDBClient tests fail </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-366">JBMESSAGING-366</a>
-] Cannot Get SSL Remoting To Work </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-368">JBMESSAGING-368</a>
-] Since 1.0.0.CR7, Serialization produces per-message DEBUG statements </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-370">JBMESSAGING-370</a>
-] Using Serialization 1.0.0.GA generates client-side
-NullPointerException </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-371">JBMESSAGING-371</a>
-] MessageListener times out on inactivity, after receiving at least one
-message </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-372">JBMESSAGING-372</a>
-] Two JMSRemotingConnections instances are created per connection. </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-391">JBMESSAGING-391</a>
-] Getting SSLException with jboss-remoting head </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-392">JBMESSAGING-392</a>
-] ConcurrentModificationException in SimpleConnectionManager </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-394">JBMESSAGING-394</a>
-] JBoss Serialization 1.0.0.GA corrupts serialized data on concurrent
-access </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-396">JBMESSAGING-396</a>
-] Client not compatible with 1.0.1.CR1 server </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-397">JBMESSAGING-397</a>
-] 1.0.1.CR1 client not compatible with this server </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-399">JBMESSAGING-399</a>
-] Race condition in deserializing Objectmessage </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-405">JBMESSAGING-405</a>
-] Memory leak with message selector </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-410">JBMESSAGING-410</a>
-] java:/JmsXA in no-tx context does not work the same way as JBossMQ </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-411">JBMESSAGING-411</a>
-] Fails with strings &gt;= 64K </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-415">JBMESSAGING-415</a>
-] Memory leak in acknowledgment </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-416">JBMESSAGING-416</a>
-] Issue with cancellation of messages on client failure </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-417">JBMESSAGING-417</a>
-] JMS Client does not exit </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-419">JBMESSAGING-419</a>
-] Getting started installation doco is broken </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-420">JBMESSAGING-420</a>
-] Channel State not reloaded on redeploy </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-421">JBMESSAGING-421</a>
-] Destination should be added to JNDI after it is loaded </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-423">JBMESSAGING-423</a>
-] Cannot retrieve long JMS string message (TextMessage) from JMS Queue </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-424">JBMESSAGING-424</a>
-] Cannot access the first message when starting the JMS subscriber </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-426">JBMESSAGING-426</a>
-] Expired messages remain on queue </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-427">JBMESSAGING-427</a>
-] MDB compatibility test fails with an 1.0.1.CR1 server </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-428">JBMESSAGING-428</a>
-] Stress tests fail </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-430">JBMESSAGING-430</a>
-] Messy close of connection consumer </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-432">JBMESSAGING-432</a>
-] One connection per unique JMS server leak </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-433">JBMESSAGING-433</a>
-] MessageConsumer.receive() successfully returned although the
-acknowledgement is failed </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-434">JBMESSAGING-434</a>
-] Client receive the server side exception </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-436">JBMESSAGING-436</a>
-] Messages are not cloned on resend </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-440">JBMESSAGING-440</a>
-] ConcurrentModificationException in transaction commit </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-442">JBMESSAGING-442</a>
-] JBoss Serialization issue with readResolve </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-448">JBMESSAGING-448</a>
-] Durable subscription state on unsubscribe </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-449">JBMESSAGING-449</a>
-] Persisted messages not removed on acknowledgement </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-450">JBMESSAGING-450</a>
-] Queue/Topic removeAllMessages is broken </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-451">JBMESSAGING-451</a>
-] Closing of non recoveranle channel does not remove references </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-452">JBMESSAGING-452</a>
-] On startup of server remaining non persistent messages are not
-cleaned properly </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-453">JBMESSAGING-453</a>
-] QueuedExecutors not being shutdown explicitly </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-477">JBMESSAGING-477</a>
-] Messages are left in the Messages table after retry message is
-printed and are retried every time the server is restarted </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-484">JBMESSAGING-484</a>
-] org.jboss.test.messaging.jms.MessageConsumerTest.testNoLocal fails
-locally and remotely </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-487">JBMESSAGING-487</a>
-] ssh smoke test fails on 4.0.4.GA </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-489">JBMESSAGING-489</a>
-] stress tests fail on dual core </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-490">JBMESSAGING-490</a>
-] Race condition on ServerConsumerEndpoint creation </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-491">JBMESSAGING-491</a>
-] Deadlock among ServerConsumerEndpoint.lock and
-RoundRobinPointToPointRouter.receiver's locks </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-492">JBMESSAGING-492</a>
-] DurableSubscriberTest, MessageConsumerTest timeout occasionally </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-493">JBMESSAGING-493</a>
-] QueuedExecutor is bounded </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-499">JBMESSAGING-499</a>
-] get-test-execution-classpath assumes windows </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-500">JBMESSAGING-500</a>
-] Intermittent race in BrowserTest::testBrowse </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-501">JBMESSAGING-501</a>
-] Race with removeAllReferences </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-503">JBMESSAGING-503</a>
-] QueueManagementTest::testMessageCount </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-506">JBMESSAGING-506</a>
-] On restart, the channel mapper throws java.sql.SQLException: Invalid
-column index </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-507">JBMESSAGING-507</a>
-] JDBCChannelMapper ignores CreateTablesOnStartup value from
-xxx-peristence-service.xml </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-508">JBMESSAGING-508</a>
-] The MessageCount property on the queue appears to climb to the
-FullSize value, then stop. </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-510">JBMESSAGING-510</a>
-] JDBCChannelMapper has a createTablesOnStartup variable but no
-overide. </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-520">JBMESSAGING-520</a>
-] Messages received from Receiver.receive() using an XA are never
-deleted from the database if not withing a transactional boundary. </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-521">JBMESSAGING-521</a>
-] IllegalStateException: Cannot find delivery to cancel for 1000
-Message test. </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-522">JBMESSAGING-522</a>
-] javax.jms.IllegalStateException: The session is closed </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-526">JBMESSAGING-526</a>
-] JMSRedelivered flag not correctly set on true in certain redelivery
-scenarios </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-531">JBMESSAGING-531</a>
-] ServerPeer destroyTopic()/destroyQueue() must not throw exception on
-non-existent destinations, but return false. </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-532">JBMESSAGING-532</a>
-] jboss-messaging.jar inappropriately packs service deployment
-descriptors </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-533">JBMESSAGING-533</a>
-] Class not found when creating durable subscription from a different
-classloading domain </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-535">JBMESSAGING-535</a>
-] Possible race condition in initialization of the server-side Remoting
-callback client:
-"org.jboss.remoting.ServerInvoker$InvalidStateException: Can not
-process invocation request since is not in started state" </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-536">JBMESSAGING-536</a>
-] The CallbackServer cannot be contacted for some particular network
-interface configurations </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-538">JBMESSAGING-538</a>
-] The MessageCount property on the queue appears to climb to the
-FullSize value, then stop </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-541">JBMESSAGING-541</a>
-] If the first opened connections is closed, Remoting Lease doesn't
-work any more </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-542">JBMESSAGING-542</a>
-] Closing connection inside MessageListener's onMessage() causes
-deadlock </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-545">JBMESSAGING-545</a>
-] Transaction edge cases and memory leak </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-546">JBMESSAGING-546</a>
-] org.jboss.test.messaging.jms.DurableSubscriberTest times out </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-549">JBMESSAGING-549</a>
-] Remoting 2.2.0.Alpha1 breaks 2 crash tests </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-564">JBMESSAGING-564</a>
-] Session.unsubscribe() leaves an active associated consumer (durable
-subscriber) in an undefined state </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-587">JBMESSAGING-587</a>
-] Fix perf/build.xml </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-588">JBMESSAGING-588</a>
-] MSSQL configuration appears invalid </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-598">JBMESSAGING-598</a>
-] secure-socket example fails on JBoss 4.0.5.CR1 </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-599">JBMESSAGING-599</a>
-]
-org.jboss.test.messaging.jms.TransactedSessionTest.testRedeliveredQueue2()
-fails </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-600">JBMESSAGING-600</a>
-]
-org.jboss.test.messaging.jms.server.destination.QueueManagementTest.testMessageCountOverFullSize()
-fails </li>
+  <li>[<a href="http://jira.jboss.com/jira/browse/JBMESSAGING-644">JBMESSAGING-644</a>]
+- Lease fails with a NPE if server is restarted and client still running</li>
+  <li>[<a href="http://jira.jboss.com/jira/browse/JBMESSAGING-660">JBMESSAGING-660</a>]
+- Race Condition Between Session.close and Session.commit or
+Session.rollback</li>
+  <li>[<a href="http://jira.jboss.com/jira/browse/JBMESSAGING-665">JBMESSAGING-665</a>]
+- 4.0.5.GA ejb3 smoke test fails</li>
 </ul>
-<h2 style="margin-left: 40px;">Task</h2>
-<ul style="margin-left: 40px;">
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-117">JBMESSAGING-117</a>
-] Document dependencies on JBoss 5.0 </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-125">JBMESSAGING-125</a>
-] Review the messaging core code for thread safety </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-172">JBMESSAGING-172</a>
-] Stress tests </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-187">JBMESSAGING-187</a>
-] Certify JBoss Messaging Content on JBoss Labs </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-195">JBMESSAGING-195</a>
-] Integration test: run existing JBossAS unit tests agains the new
-stack </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-215">JBMESSAGING-215</a>
-] Factor common behavior out of JDBC support classes
-(JDBCTransactionLog, JDBCMessageStore and JDBCDurableSubscriptionStore)
-  </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-280">JBMESSAGING-280</a>
-] Allow datasource to be configurable in servicecontainer </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-282">JBMESSAGING-282</a>
-] Document how to use the functional test suite </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-295">JBMESSAGING-295</a>
-] Make serialization manager pluggable </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-303">JBMESSAGING-303</a>
-] Describe how jboss-messaging and ejb3 need to be configured to work
-together </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-304">JBMESSAGING-304</a>
-] Use TransactionManagerLocator instead of TxManager </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-311">JBMESSAGING-311</a>
-] Add destination deployment params test </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-316">JBMESSAGING-316</a>
-] Extend the smoke matrix to test all JBoss 4.X released versions </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-318">JBMESSAGING-318</a>
-] Review the user guide and send it to the documentation team for
-processing </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-320">JBMESSAGING-320</a>
-] Validate Messaging with *ALL* released JBoss 4.0.X versions </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-328">JBMESSAGING-328</a>
-] Optimisation - batch messages to consumers </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-338">JBMESSAGING-338</a>
-] Include all "installer" installation in the smoke test matrix </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-341">JBMESSAGING-341</a>
-] Modify the ant release task to bundle the test source code with the
-release </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-347">JBMESSAGING-347</a>
-] Use Serialization release that fixed the bug described in JBSER-59 </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-350">JBMESSAGING-350</a>
-] Test and bundle the Postgres configuration example </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-356">JBMESSAGING-356</a>
-] Split jboss-service.xml into their own files </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-358">JBMESSAGING-358</a>
-] Provide a docs/example EJB3 MDB example </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-369">JBMESSAGING-369</a>
-] Add backward and forward compatibilty tests to run on release </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-376">JBMESSAGING-376</a>
-] Hand over the release to the QA team </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-389">JBMESSAGING-389</a>
-] Test with JBoss AOP 1.5.0.GA </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-393">JBMESSAGING-393</a>
-] Remove the serverless packages from CVS </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-401">JBMESSAGING-401</a>
-] Release 1.0.1 GA after waiting for a week for feedback on the latest
-CR </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-403">JBMESSAGING-403</a>
-] The Getting Started guide contains obsolete version numbers </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-418">JBMESSAGING-418</a>
-] JMS examples not handling exceptions properly </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-431">JBMESSAGING-431</a>
-] Socket transports should use configurable port </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-441">JBMESSAGING-441</a>
-] Refactoring of message delivery </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-472">JBMESSAGING-472</a>
-] Test and use remoting 2.0.0.CR1 (or 2.0.0.GA if it's released in
-time) </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-481">JBMESSAGING-481</a>
-] Implement a round robin routing strategy for queues and subscriptions
-  </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-485">JBMESSAGING-485</a>
-] CTSMiscellaneousTest.testContestedQueueOnRollback temporarily
-commented out </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-502">JBMESSAGING-502</a>
-] Create a MSSQL persistence manager config </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-504">JBMESSAGING-504</a>
-] Release with a tagged JBossSerialization jar </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-529">JBMESSAGING-529</a>
-] Install TCK5 locally and fix all errors that prevent Messaging from
-passing </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-530">JBMESSAGING-530</a>
-] Make sure QA cruisecontrol tests Branch_1_0 </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-534">JBMESSAGING-534</a>
-] Create a new "messaging" subdirectory in repository.jboss.com and
-start uploading messaging artifacts there </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-547">JBMESSAGING-547</a>
-] Upgrade JBossSerialization to 1.0.3.GA </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-551">JBMESSAGING-551</a>
-] Upgrade JBoss Remoting </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-559">JBMESSAGING-559</a>
-] Add a 4.0.5.CR1 EJB3 smoke test </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-590">JBMESSAGING-590</a>
-] Add JBoss 4.0.4.SP1 to the smoke test suite </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-591">JBMESSAGING-591</a>
-] MessageConsumerTest::testTimeoutReceiveOnClose can randomly fail </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-602">JBMESSAGING-602</a>
-] Clear all open user issues on the forum<br>
-  </li>
-</ul>
 <h2 style="margin-left: 40px;">Sub-task</h2>
-<ul style="margin-left: 40px;">
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-317">JBMESSAGING-317</a>
-] Test the client jar with all JBoss 4.X released versions </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-349">JBMESSAGING-349</a>
-] Standalone Messaging based on "extracted" JBoss 4.0.3SP1 </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-351">JBMESSAGING-351</a>
-] EJB3 MDB example </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-360">JBMESSAGING-360</a>
-] BytesJBossMessage fails with jboss-serialization 1.0.0.CR7 </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-361">JBMESSAGING-361</a>
-] WireFormatTest.testNullResponse(), testDeactivateResponse() fragments
-invalid </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-479">JBMESSAGING-479</a>
-] Implement iteration </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-486">JBMESSAGING-486</a>
-] Re-enable user documentation generation </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-496">JBMESSAGING-496</a>
-] The remoting snapshot breaks
-ConnectionFactoryTest.testAdministrativelyConfiguredConnectors() in-vm
-and remote </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-497">JBMESSAGING-497</a>
-] The remoting snapshot breaks TopicManagementTest (timeout) </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-498">JBMESSAGING-498</a>
-] StressTest.testTopicMultipleReceivers() (InVM) fails </li>
-  <li> [ <a href="http://jira.jboss.com/jira/browse/JBMESSAGING-539">JBMESSAGING-539</a>
-] Rig an RI and investigate the behavior of an XASession in absence of
-a global transaction </li>
+<div style="margin-left: 40px;">
+<ul>
+  <li>[<a href="http://jira.jboss.org/jira/browse/JBMESSAGING-666">JBMESSAGING-666</a>]
+-&nbsp; Basic DLQ functionality</li>
 </ul>
+</div>
+<br>
 <h2 style="margin-left: 40px;"><br>
 </h2>
 <br>

Modified: branches/Branch_1_0/docs/examples/ejb3mdb/do-not-distribute.properties
===================================================================
--- branches/Branch_1_0/docs/examples/ejb3mdb/do-not-distribute.properties	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/docs/examples/ejb3mdb/do-not-distribute.properties	2006-12-03 08:36:09 UTC (rev 1693)
@@ -4,5 +4,6 @@
 #
 messaging.client.jar.path=../../../output/lib
 messaging.client.jar.name=jboss-messaging-client.jar
-jboss.configuration=messaging-smoke-test
+jboss.configuration=messaging
 jboss.home=C:\\work\\src\\jboss-4.0.5.CR1-src\\build\\output\\jboss-4.0.5.CR1-ejb3
+jboss.home=C:\\work\\src\\jboss-4.0.5.GA-src\\build\\output\\jboss-4.0.5.GA-ejb3

Modified: branches/Branch_1_0/docs/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/EJB3MDBExample.java
===================================================================
--- branches/Branch_1_0/docs/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/EJB3MDBExample.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/docs/examples/ejb3mdb/src/org/jboss/example/jms/ejb3mdb/EJB3MDBExample.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -30,7 +30,8 @@
 @MessageDriven(activationConfig =
 {
       @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
-      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/testQueue")
+      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/testQueue"),
+      @ActivationConfigProperty(propertyName="DLQMaxResent", propertyValue="10")
 })
 public class EJB3MDBExample implements MessageListener
 {

Modified: branches/Branch_1_0/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java
===================================================================
--- branches/Branch_1_0/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -217,8 +217,21 @@
     */
    public HandleMessageResponse handleMessage(List msgs) throws HandleCallbackException
    {            
-      if (trace) { log.trace(this + " receiving " + msgs.size() + " message(s) from the remoting layer"); }
-                      
+      if (trace)
+      {
+         StringBuffer sb = new StringBuffer(this + " receiving [");
+         for(int i = 0; i < msgs.size(); i++)
+         {
+            sb.append(((MessageProxy)msgs.get(i)).getMessage().getMessageID());
+            if (i < msgs.size() - 1)
+            {
+               sb.append(",");
+            }
+         }
+         sb.append("] from the remoting layer");
+         log.trace(sb.toString());
+      }
+
       synchronized (mainLock)
       {
          if (closed)
@@ -233,7 +246,7 @@
                    
          buffer.addAll(msgs);                  
          
-         if (trace) { log.trace(this + " added messages to the buffer"); }            
+         if (trace) { log.trace(this + " added message(s) to the buffer"); }
          
          boolean full = buffer.size() >= bufferSize;         
          
@@ -341,9 +354,9 @@
       {
          sessionExecutor.execute(new Closer(result));
 
-         if (trace) { log.trace("blocking wait for Closer execution"); }
+         if (trace) { log.trace(this + " blocking wait for Closer execution"); }
          result.getResult();
-         if (trace) { log.trace("got Closer result"); }
+         if (trace) { log.trace(this + " got Closer result"); }
       }
       catch (InterruptedException e)
       {
@@ -426,7 +439,7 @@
                   }
                }
                               
-               if (trace) { log.trace("received " + m + " after being blocked on buffer"); }
+               if (trace) { log.trace(this + " received " + m + " after being blocked on buffer"); }
                        
                // If message is expired we still call pre and post deliver. This makes sure the
                // message is acknowledged so it gets removed from the queue/subscription.
@@ -436,14 +449,14 @@
                
                if (!m.getMessage().isExpired())
                {
-                  if (trace) { log.trace("message " + m + " is not expired, pushing it to the caller"); }
+                  if (trace) { log.trace(this + ": message " + m + " is not expired, pushing it to the caller"); }
                   
                   break;
                }
                
                if (trace)
                {
-                  log.trace("message expired, discarding");
+                  log.trace(this + ": message expired, discarding");
                }
                
                // the message expired, so discard the message, adjust timeout and reenter the buffer

Modified: branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -753,7 +753,7 @@
          if (trace) { log.trace("sent " + m); }
       }
       
-      if (trace) { log.trace("done the sends"); }
+      if (trace) { log.trace(tx + ": done the sends"); }
       
       // Then ack the acks
       
@@ -775,7 +775,7 @@
          if (trace) { log.trace("acked " + ack.getMessageID()); }
       }
       
-      if (trace) { log.trace("done the acks"); }
+      if (trace) { log.trace(tx + ": done the acks"); }
    }   
 
    // Inner classes -------------------------------------------------

Modified: branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -21,17 +21,16 @@
  */
 package org.jboss.jms.server.endpoint;
 
-
+import EDU.oswego.cs.dl.util.concurrent.Executor;
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-
 import javax.jms.IllegalStateException;
 import javax.jms.InvalidSelectorException;
 import javax.jms.JMSException;
-
 import org.jboss.jms.client.remoting.HandleMessageResponse;
 import org.jboss.jms.destination.JBossDestination;
 import org.jboss.jms.message.JBossMessage;
@@ -59,9 +58,6 @@
 import org.jboss.messaging.core.tx.TxCallback;
 import org.jboss.messaging.util.Future;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
-
 /**
  * Concrete implementation of ConsumerEndpoint. Lives on the boundary between Messaging Core and the
  * JMS Facade.
@@ -533,22 +529,27 @@
    {         
       if (trace) log.trace("attempting to remove receiver " + this + " from destination " + channel);
       
-      boolean wereDeliveries = false;
-      for(Iterator i = deliveries.values().iterator(); i.hasNext(); )
-      {
-         SingleReceiverDelivery d = (SingleReceiverDelivery)i.next();
-
-         d.cancel();
-         wereDeliveries = true;
-      }
-      deliveries.clear();           
+      boolean wereDeliveries = false;       
       
-      if (!disconnected)
-      {
-         if (!closed)
+      synchronized (lock)
+      {          
+         for (Iterator i = deliveries.values().iterator(); i.hasNext(); )
          {
-            close();
+            SingleReceiverDelivery d = (SingleReceiverDelivery)i.next();
+   
+            d.cancel();
+            wereDeliveries = true;
          }
+               
+         deliveries.clear();           
+         
+         if (!disconnected)
+         {
+            if (!closed)
+            {
+               close();
+            }
+         }
       }
       
       sessionEndpoint.getConnectionEndpoint().
@@ -603,8 +604,13 @@
    
    protected void cancelDelivery(Long messageID, int deliveryCount) throws Throwable
    {
-      SingleReceiverDelivery del = (SingleReceiverDelivery)deliveries.remove(messageID);
+      SingleReceiverDelivery del = null;
       
+      synchronized (lock)
+      {         
+         del = (SingleReceiverDelivery)deliveries.remove(messageID);
+      }
+      
       if (del != null)
       {                               
          //Cancel back to the queue
@@ -659,10 +665,10 @@
          {
             return;
          }
+      }
          
-         started = false;
-      }
-      
+      started = false;      
+   
       //Now we know no more messages will be accepted in the SCE
             
       try
@@ -691,22 +697,19 @@
             
       if (!toDeliver.isEmpty())
       { 
-         synchronized (lock)
+         for (int i = toDeliver.size() - 1; i >= 0; i--)
          {
-            for (int i = toDeliver.size() - 1; i >= 0; i--)
-            {
-               MessageProxy proxy = (MessageProxy)toDeliver.get(i);
-               
-               long id = proxy.getMessage().getMessageID();
-               
-               cancelDelivery(new Long(id), proxy.getMessage().getDeliveryCount());
-            }
+            MessageProxy proxy = (MessageProxy)toDeliver.get(i);
+            
+            long id = proxy.getMessage().getMessageID();
+            
+            cancelDelivery(new Long(id), proxy.getMessage().getDeliveryCount());
          }
-                 
+             
          toDeliver.clear();
          
          bufferFull = false;
-      }      
+      }            
    }
       
    // Private -------------------------------------------------------
@@ -772,8 +775,21 @@
 
          try
          {
-            if (trace) { log.trace(ServerConsumerEndpoint.this + " handing " + list.size() + " message(s) over to the remoting layer"); }
-
+            if (trace)
+            {
+               StringBuffer sb = new StringBuffer(ServerConsumerEndpoint.this + " handing [");
+               for(int i = 0; i < list.size(); i++)
+               {
+                  sb.append(((MessageProxy)list.get(i)).getMessage().getMessageID());
+                  if (i < list.size() - 1)
+                  {
+                     sb.append(",");
+                  }
+               }
+               sb.append("] over to the remoting layer");
+               log.trace(sb.toString());
+            }
+            
             ClientDelivery del = new ClientDelivery(list, id);
 
             // TODO How can we ensure that messages for the same consumer aren't delivered
@@ -866,15 +882,17 @@
       
       public synchronized void afterCommit(boolean onePhase) throws TransactionException
       {
-         // Remove the deliveries from the delivery map.
-         Iterator iter = delList.iterator();
-         while (iter.hasNext())
+         synchronized (lock)
          {
-            Long messageID = (Long)iter.next();
-            
-            if (deliveries.remove(messageID) == null)
+            // Remove the deliveries from the delivery map.
+            Iterator iter = delList.iterator();
+            while (iter.hasNext())
             {
-               throw new TransactionException("Failed to remove delivery " + messageID);
+               Long messageID = (Long)iter.next();
+               
+               //The message might have been removed already if the consumer was closed for instance
+               //This is ok
+               deliveries.remove(messageID);               
             }
          }
       }

Modified: branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -384,7 +384,7 @@
       }
    }
 
-   public void close() throws JMSException
+   public synchronized void close() throws JMSException
    {
       try
       {
@@ -438,10 +438,15 @@
       }
    }
    
-   public void acknowledgeBatch(List ackInfos) throws JMSException
+   public synchronized void acknowledgeBatch(List ackInfos) throws JMSException
    {      
       try
       {
+         if (closed)
+         {
+            throw new javax.jms.IllegalStateException("Cannot acknowledge batch since session is closed");
+         }
+                  
          Iterator iter = ackInfos.iterator();
          
          while (iter.hasNext())
@@ -457,10 +462,15 @@
       }
    }
    
-   public void acknowledge(AckInfo ackInfo) throws JMSException
+   public synchronized void acknowledge(AckInfo ackInfo) throws JMSException
    {
       try
       {
+         if (closed)
+         {
+            throw new javax.jms.IllegalStateException("Cannot acknowledge " + ackInfo + " since session is closed");
+         }
+         
          acknowledgeInternal(ackInfo);      
       }
       catch (Throwable t)
@@ -469,10 +479,19 @@
       }
    }      
         
-   public void cancelDeliveries(List ackInfos) throws JMSException
+   public synchronized void cancelDeliveries(List ackInfos) throws JMSException
    {
       try
       {
+         if (closed)
+         {
+            //We can safely ignore any cancels since closing the session will have cancelled anything
+            //remaining
+            log.warn("Call to cancelDeliveries came in after session was closed");
+            
+            return;
+         }
+         
          // deliveries must be cancelled in reverse order
           
          Set consumers = new HashSet();
@@ -721,11 +740,12 @@
    
    protected void acknowledgeInternal(AckInfo ackInfo) throws Throwable
    {
-      //If the message was delivered via a connection consumer then the message needs to be acked
-      //via the original consumer that was used to feed the connection consumer - which
-      //won't be one of the consumers of this session
-      //Therefore we always look in the global map of consumers held in the server peer
-      ServerConsumerEndpoint consumer = this.connectionEndpoint.getConsumerEndpoint(ackInfo.getConsumerID());
+      // If the message was delivered via a connection consumer then the message needs to be acked
+      // via the original consumer that was used to feed the connection consumer - which won't be
+      // one of the consumers of this session. Therefore we always look in the global map of
+      // consumers held in the server peer.
+      ServerConsumerEndpoint consumer =
+         connectionEndpoint.getConsumerEndpoint(ackInfo.getConsumerID());
 
       if (consumer == null)
       {

Modified: branches/Branch_1_0/src/main/org/jboss/messaging/core/ChannelSupport.java
===================================================================
--- branches/Branch_1_0/src/main/org/jboss/messaging/core/ChannelSupport.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/src/main/org/jboss/messaging/core/ChannelSupport.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -21,6 +21,8 @@
  */
 package org.jboss.messaging.core;
 
+import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -30,7 +32,6 @@
 import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
-
 import org.jboss.logging.Logger;
 import org.jboss.messaging.core.memory.MemoryManager;
 import org.jboss.messaging.core.plugin.contract.MessageStore;
@@ -42,9 +43,6 @@
 import org.jboss.messaging.core.tx.TxCallback;
 import org.jboss.messaging.util.Future;
 
-import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
-
 /**
  * Channel implementation. It supports atomicity, isolation and recoverability of reliable messages.
  * The channel implementation here uses a "SEDA-type" approach, where requests to handle messages,
@@ -52,11 +50,12 @@
  * queue and executed serially by a single thread. This prevents lock contention since requests are
  * executed serially, resulting in better scalability and higher throughput at the expense of some
  * latency.
- * 
+ *
  * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt> $Id: ChannelSupport.java,v 1.65
- *          2006/06/27 19:44:39 timfox Exp $
+ * @version <tt>$Revision$</tt>
+ *
+ * $Id$
  */
 public abstract class ChannelSupport implements Channel
 {
@@ -203,11 +202,11 @@
    public Delivery handle(DeliveryObserver sender, Routable r, Transaction tx)
    {
       checkClosed();
-      
+
       Future result = new Future();
 
       if (tx == null)
-      {         
+      {
          try
          {
             // Instead of executing directly, we add the handle request to the event queue.
@@ -220,7 +219,7 @@
          {
             log.warn("Thread interrupted", e);
          }
-   
+
          return (Delivery)result.getResult();
       }
       else
@@ -228,7 +227,7 @@
          return this.handleInternal(sender, r, tx);
       }
    }
-      
+
    // DeliveryObserver implementation --------------------------
 
    public void acknowledge(Delivery d, Transaction tx) throws Throwable
@@ -252,7 +251,7 @@
          // Future result = new Future();
          //
          // this.executor.execute(new AcknowledgeRunnable(d, result));
-         //               
+         //
          // //For now we wait for result, but this may not be necessary
          // result.getResult();
          // }
@@ -280,29 +279,8 @@
 
    public void cancel(Delivery d) throws Throwable
    {
-      // We put the cancellation on the event queue
-      // try
-      // {
-      // Future result = new Future();
-      //         
-      // this.executor.execute(new CancelRunnable(d, result));
-      //         
-      // //For now we wait for result, but this may not be necessary
-      // result.getResult();
-      // }
-      // catch (InterruptedException e)
-      // {
-      // log.warn("Thread interrupted", e);
-      // }
-
-//      Exception e = new Exception();
-//      
-//      log.error("cancelling delivery: " + d, e);
-//      
-      
-      
-      // TODO We should also consider executing cancels on the event queue
-      cancelInternal(d);   
+       //We put the cancellation on the event queue
+       this.executor.execute(new CancelRunnable(d));
    }
 
    // Distributor implementation ------------------------------------
@@ -314,7 +292,7 @@
       boolean added = router.add(r);
 
       if (trace) { log.trace("receiver " + r + (added ? "" : " NOT") + " added"); }
-      
+
       receiversReady = true;
       return added;
    }
@@ -372,7 +350,7 @@
          log.trace(this + " browse"
                   + (filter == null ? "" : ", filter = " + filter));
       }
-      
+
       synchronized (deliveryLock)
       {
          synchronized (refLock)
@@ -380,14 +358,14 @@
             //FIXME - This is currently broken since it doesn't take into account
             // refs paged into persistent storage
             // Also is very inefficient since it makes a copy
-            
+
             //TODO use the ref queue iterator
             List references = delivering(filter);
-                        
-            List undel = undelivered(filter);            
 
+            List undel = undelivered(filter);
+
             references.addAll(undel);
-            
+
             // dereference pass
             ArrayList messages = new ArrayList(references.size());
             for (Iterator i = references.iterator(); i.hasNext();)
@@ -397,25 +375,25 @@
             }
             return messages;
          }
-      }   
+      }
    }
 
    public void deliver(boolean synchronous)
    {
-      checkClosed();           
-     
+      checkClosed();
+
       // We put a delivery request on the event queue.
       try
       {
          Future future = null;
-         
+
          if (synchronous)
          {
             future = new Future();
          }
-                  
+
          this.executor.execute(new DeliveryRunnable(future));
-         
+
          if (synchronous)
          {
             // Wait to complete
@@ -435,25 +413,25 @@
          router.clear();
          router = null;
       }
-      
-   }  
-   
+
+   }
+
    /*
     * This method clears the channel.
     * Basically it acknowledges any outstanding deliveries and consumes the rest of the messages in the channel.
     * We can't just delete the corresponding references directly from the database since
     * a) We might be paging
     * b) The message might remain in the message store causing a leak
-    * 
+    *
     */
    public void removeAllReferences() throws Throwable
-   {        
+   {
       synchronized (refLock)
       {
          synchronized (deliveryLock)
          {
             //Ack the deliveries
-            
+
             //Clone to avoid ConcurrentModificationException
             Set dels = new HashSet(deliveries);
 
@@ -461,26 +439,26 @@
             while (iter.hasNext())
             {
                SimpleDelivery d = (SimpleDelivery) iter.next();
-               
+
                d.acknowledge(null);
             }
-            
+
             //Now we consume the rest of the messages
             //This may take a while if we have a lot of messages including perhaps millions
             //paged in the database - but there's no obvious other way to do it.
             //We cannot just delete them directly from the database - because we may end up with messages leaking
             //in the message store,
             //also we might get race conditions when other channels are updating the same message in the db
-            
+
             //Note - we don't do this in a tx - because the tx could be too big if we have millions of refs
             //paged in storage
-            
+
             MessageReference ref;
             while ((ref = removeFirstInMemory()) != null)
             {
                SimpleDelivery del = new SimpleDelivery(this, ref, false);
-               
-               del.acknowledge(null);           
+
+               del.acknowledge(null);
             }
          }
       }
@@ -580,7 +558,7 @@
     * Returns the count of messages stored AND being delivered.
     */
    public int messageCount()
-   {   
+   {
       synchronized (refLock)
       {
          synchronized (deliveryLock)
@@ -636,8 +614,8 @@
    /*
     * This methods delivers as many messages as possible to the router until no
     * more deliveries are returned. This method should never be called at the
-    * same time as handle. 
-    * 
+    * same time as handle.
+    *
     * @see org.jboss.messaging.core.Channel#deliver()
     */
    protected void deliverInternal()
@@ -647,13 +625,13 @@
          // The iterator is used to iterate through the refs in the channel in the case that they
          // don't match the selectors of any receivers.
          ListIterator iter = null;
-         
+
          MessageReference ref = null;
-         
+
          while (true)
-         {           
+         {
             synchronized (refLock)
-            {              
+            {
                if (iter == null)
                {
                   ref = (MessageReference) messageRefs.peekFirst();
@@ -661,9 +639,9 @@
                else
                {
                   if (iter.hasNext())
-                  {                        
+                  {
                      ref = (MessageReference)iter.next();
-                  } 
+                  }
                   else
                   {
                      ref = null;
@@ -673,6 +651,8 @@
 
             if (ref != null)
             {
+            	if (trace) { log.trace(this + " pushing " + ref); }
+                        
                // Check if message is expired (we also do this on the client
                // side)
                // If so ack it from the channel
@@ -710,15 +690,15 @@
                      if (trace) { log.trace(this + ": no delivery returned for message" + ref + " so no receiver got the message. Delivery is now complete"); }
 
                      receiversReady = false;
-                     
+
                      return;
                   }
                   else if (!del.isSelectorAccepted())
                   {
                      // No receiver accepted the message because no selectors matched, so we create
                      // an iterator (if we haven't already created it) to iterate through the refs
-                     // in the channel. 
-                     
+                     // in the channel.
+
                      // TODO Note that this is only a partial solution since if there are messages
                      // paged to storage it won't try those - i.e. it will only iterate through
                      // those refs in memory. Dealing with refs in storage is somewhat tricky since
@@ -731,12 +711,12 @@
                      if (iter == null)
                      {
                         iter = messageRefs.iterator();
-                     }                     
+                     }
                   }
                   else
                   {
                      if (trace) { log.trace(this + ": " + del + " returned for message:" + ref); }
-                     
+
                      // Receiver accepted the reference
 
                      // We must synchronize here to cope with another race condition where message
@@ -766,7 +746,9 @@
                            }
                            else
                            {
-                              iter.remove();                                
+                              iter.remove();     
+                              if (trace) { log.trace(this + " removed current message from iterator"); }                           
+
                            }
 
                            // delivered
@@ -776,6 +758,7 @@
                               synchronized (deliveryLock)
                               {
                                  deliveries.add(del);
+                                 if (trace) { log.trace(this + " starting to track  " + del); }
                               }
                            }
                         }
@@ -818,9 +801,9 @@
             //pages and is non recoverable a reliable ref will be paged in the database as reliable
             //which makes them hard to remove on server restart.
             //If we always page them as unreliable then it is easy to remove them.
-            ref.setReliable(false);               
+            ref.setReliable(false);
          }
-         
+
          if (tx == null)
          {
             // Don't even attempt synchronous delivery for a reliable message
@@ -838,18 +821,18 @@
                return null;
             }
 
-            checkMemory();                        
+            checkMemory();
 
             ref.setOrdering(messageOrdering.increment());
-            
+
             if (ref.isReliable() && recoverable)
             {
                // Reliable message in a recoverable state - also add to db
                if (trace) { log.trace(this + "adding " + ref + " to database non-transactionally"); }
 
-               pm.addReference(channelID, ref, null);               
+               pm.addReference(channelID, ref, null);
             }
-            
+
             addReferenceInMemory(ref);
 
             // We only do delivery if there are receivers that haven't said they don't want
@@ -877,17 +860,13 @@
                   log.trace(this + " cannot handle reliable messages, dooming the transaction");
                }
                tx.setRollbackOnly();
-            } 
+            }
             else
             {
                // add to post commit callback
                ref.setOrdering(messageOrdering.increment());
                this.getCallback(tx).addRef(ref);
-               if (trace)
-               {
-                  log.trace(this + " added transactionally " + ref
-                           + " in memory");
-               }
+               if (trace) { log.trace(this + " added " + ref + " to memory transactional callback, in transaction: " + tx); }
             }
 
             if (ref.isReliable() && recoverable)
@@ -913,26 +892,23 @@
    }
 
    protected void acknowledgeInternal(Delivery d) throws Exception
-   {      
+   {
       synchronized (deliveryLock)
       {
          acknowledgeInMemory(d);
       }
-         
+
       if (recoverable && d.getReference().isReliable())
       {
          pm.removeReference(channelID, d.getReference(), null);
       }
-           
-      d.getReference().releaseMemoryReference();        
+
+      d.getReference().releaseMemoryReference();
    }
 
    protected void cancelInternal(Delivery del) throws Exception
    {
-      if (trace)
-      {
-         log.trace(this + " cancelling " + del + " in memory");
-      }
+      if (trace) { log.trace(this + " cancelling " + del + " in memory"); }
 
       boolean removed;
 
@@ -968,14 +944,14 @@
                refsInStorage++;
             }
          }
-         
+
          //We may need to update the delivery count in the database
          if (ref.isReliable())
          {
             pm.updateDeliveryCount(this.channelID, ref);
          }
 
-         if (trace) { log.trace(this + " added " + ref + " back into state"); }
+         if (trace) { log.trace(this + " added " + ref + " back into memory, ready for redelivery"); }
       }
    }
 
@@ -999,6 +975,7 @@
             paging = false;
          }
 
+         if (trace) { log.trace(this + " removing first message in memory, which is " + result); }
          return (MessageReference) result;
       }
    }
@@ -1043,21 +1020,21 @@
       // if (mm != null)
       // {
       // boolean isLow = mm.isMemoryLow();
-      //         
+      //
       // if (isLow)
       // {
-      //            
+      //
       // synchronized (refLock)
       // {
       // if (!paging)
       // {
       // log.info("Memory is low:" + this);
-      //                  
+      //
       // fullSize = messageRefs.size() + 1;
-      //                  
+      //
       // //TODO Make this configurable
       // pageSize = downCacheSize = Math.max(1, fullSize / 50);
-      //                  
+      //
       // log.info("Turned paging on, fullSize=" + fullSize + " dc:" +
       // downCacheSize + " ps: " + pageSize);
       // }
@@ -1065,7 +1042,7 @@
       // {
       // //log.info("already paging");
       // }
-      //               
+      //
       // }
       // }
       // }
@@ -1091,11 +1068,7 @@
          {
             messageRefs.addLast(ref, ref.getPriority());
 
-            if (trace)
-            {
-               log.trace(this + " added " + ref
-                        + " non-transactionally in memory");
-            }
+            if (trace) { log.trace(this + " added " + ref + " in memory"); }
 
             if (messageRefs.size() == fullSize)
             {
@@ -1250,7 +1223,7 @@
       {
          log.trace(this + " removed " + d + " from memory:" + removed);
       }
-      
+
       return removed;
    }
 
@@ -1268,7 +1241,7 @@
 
       // We may load less than desired due to "holes" - this is ok
       int numberLoaded = refInfos.size();
-      
+
       if (numberLoaded == 0)
       {
          throw new IllegalStateException(
@@ -1331,7 +1304,7 @@
             // return a reference
             // to the pre-existing message
             MessageReference ref = ms.reference(m);
-            
+
             refMap.put(new Long(m.getMessageID()), ref);
          }
       }
@@ -1366,15 +1339,15 @@
          ref.setDeliveryCount(info.getDeliveryCount());
 
          ref.setOrdering(info.getOrdering());
-         
+
          //We ignore the reliable field from the message - this is because reliable might be true on the message
          //but this is a non recoverable state
-         
+
          //FIXME - Really the message shouldn't have a reliable field at all,
          //Reliability is an attribute of the message reference, not the message
-         
+
          ref.setReliable(info.isReliable());
-         
+
          messageRefs.addLast(ref, ref.getPriority());
 
          if (recoverable && ref.isReliable())
@@ -1436,8 +1409,8 @@
 
       return callback;
    }
-   
 
+
    // Private -------------------------------------------------------
 
    // Inner classes -------------------------------------------------
@@ -1591,7 +1564,7 @@
          {
             MessageReference ref = (MessageReference) iter.next();
 
-            if (trace) { log.trace(this + ": adding " + ref + " to non-recoverable state"); }
+            if (trace) { log.trace(this + " adding " + ref + " to memory"); }
 
             try
             {
@@ -1687,7 +1660,7 @@
 
       return d;
    }
-   
+
    private void checkClosed()
    {
       if (router == null)
@@ -1695,18 +1668,18 @@
          throw new IllegalStateException(this + " closed");
       }
    }
-  
+
    // Inner classes -------------------------------------------------
 
    private class DeliveryRunnable implements Runnable
    {
       Future result;
-      
+
       DeliveryRunnable(Future result)
       {
          this.result = result;
       }
-      
+
       public void run()
       {
          receiversReady = true;
@@ -1718,6 +1691,28 @@
       }
    }
 
+   private class CancelRunnable implements Runnable
+   {
+      Delivery del;
+
+      CancelRunnable(Delivery del)
+      {
+         this.del = del;
+      }
+
+      public void run()
+      {
+         try
+         {
+            cancelInternal(del);
+         }
+         catch (Exception e)
+         {
+            log.error("Failed to cancel delivery", e);
+         }
+      }
+   }
+
    private class HandleRunnable implements Runnable
    {
       Future result;
@@ -1738,5 +1733,5 @@
          Delivery d = handleInternal(sender, routable, null);
          result.setResult(d);
       }
-   }   
+   }
 }

Modified: branches/Branch_1_0/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java
===================================================================
--- branches/Branch_1_0/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/src/main/org/jboss/messaging/core/plugin/JDBCPersistenceManager.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -398,7 +398,7 @@
             
             ps.setLong(2, size);
             
-            int rows = ps.executeUpdate();
+            int rows = updateWithRetry(ps);
             
             if (trace)
             {
@@ -430,7 +430,7 @@
          
          ps.setString(2, counterName);
          
-         int rows = ps.executeUpdate();
+         int rows = updateWithRetry(ps);
          
          if (trace)
          {
@@ -483,8 +483,6 @@
       PreparedStatement ps = null;
       TransactionWrapper wrap = new TransactionWrapper();
       
-      final int MAX_TRIES = 25;      
-      
       try
       {
          conn = ds.getConnection();
@@ -496,41 +494,15 @@
          ps.setLong(2, orderEnd);
          
          ps.setLong(3, channelID);
-         
-         int tries = 0;
-         
-         while (true)
+                  
+         int rows = updateWithRetry(ps);
+               
+         if (trace)
          {
-            try
-            {
-               int rows = ps.executeUpdate();
-               
-               if (trace)
-               {
-                  log.trace(JDBCUtil.statementToString(updateReliableRefs, new Long(channelID),
-                        new Long(orderStart), new Long(orderEnd))
-                        + " updated " + rows + " rows");
-               }
-               if (tries > 0)
-               {
-                  log.warn("Update worked after retry");
-               }
-               break;
-            }
-            catch (SQLException e)
-            {
-               log.warn("SQLException caught - assuming deadlock detected, try:" + (tries + 1), e);
-               tries++;
-               if (tries == MAX_TRIES)
-               {
-                  log.error("Retried " + tries + " times, now giving up");
-                  throw new IllegalStateException("Failed to update references");
-               }
-               log.warn("Trying again after a pause");
-               //Now we wait for a random amount of time to minimise risk of deadlock
-               Thread.sleep((long)(Math.random() * 500));
-            }  
-         }
+            log.trace(JDBCUtil.statementToString(updateReliableRefs, new Long(channelID),
+                  new Long(orderStart), new Long(orderEnd))
+                  + " updated " + rows + " rows");
+         }          
       }
       catch (Exception e)
       {
@@ -562,6 +534,8 @@
          wrap.end();
       }
    }
+   
+   
          
    public int getNumberOfUnloadedReferences(long channelID) throws Exception
    {
@@ -980,7 +954,7 @@
             }
             else
             {
-               int rows = psInsertReference.executeUpdate();
+               int rows = updateWithRetry(psInsertReference);
                
                if (trace)
                {
@@ -1037,7 +1011,7 @@
             {
                if (added)
                {
-                  int rows = psInsertMessage.executeUpdate();
+                  int rows = updateWithRetry(psInsertMessage);
                                       
                   if (trace)
                   {
@@ -1046,7 +1020,7 @@
                }
                else
                {
-                  int rows = psUpdateMessage.executeUpdate();
+                  int rows = updateWithRetry(psUpdateMessage);
                  
                   if (trace)
                   {
@@ -1062,7 +1036,7 @@
          
          if (usingBatchUpdates)
          {
-            int[] rowsReference = psInsertReference.executeBatch();
+            int[] rowsReference = updateWithRetryBatch(psInsertReference);
             
             if (trace)
             {
@@ -1071,7 +1045,7 @@
             
             if (messageInsertsInBatch)
             {
-               int[] rowsMessage = psInsertMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psInsertMessage);
                
                if (trace)
                {
@@ -1080,7 +1054,7 @@
             }
             if (messageUpdatesInBatch)
             {
-               int[] rowsMessage = psUpdateMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psUpdateMessage);
                
                if (trace)
                {
@@ -1213,7 +1187,7 @@
             }
             else
             {
-               int rows = psDeleteReference.executeUpdate();
+               int rows = updateWithRetry(psDeleteReference);
                
                if (trace)
                {
@@ -1271,7 +1245,7 @@
             {
                if (removed)
                {
-                  int rows = psDeleteMessage.executeUpdate();
+                  int rows = updateWithRetry(psDeleteMessage);
                   
                   if (trace)
                   {
@@ -1280,7 +1254,7 @@
                }
                else
                {
-                  int rows = psUpdateMessage.executeUpdate();
+                  int rows = updateWithRetry(psUpdateMessage);
                   
                   if (trace)
                   {
@@ -1296,7 +1270,7 @@
          
          if (usingBatchUpdates)
          {
-            int[] rowsReference = psDeleteReference.executeBatch();
+            int[] rowsReference = updateWithRetryBatch(psDeleteReference);
             
             if (trace)
             {
@@ -1305,7 +1279,7 @@
             
             if (messageDeletionsInBatch)
             {
-               int[] rowsMessage = psDeleteMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psDeleteMessage);
                
                if (trace)
                {
@@ -1314,7 +1288,7 @@
             }
             if (messageUpdatesInBatch)
             {
-               int[] rowsMessage = psUpdateMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psUpdateMessage);
                
                if (trace)
                {
@@ -1682,7 +1656,7 @@
             }
             else
             {
-               int rows = psUpdateReference.executeUpdate();
+               int rows = updateWithRetry(psUpdateReference);
                
                if (trace)
                {
@@ -1696,7 +1670,7 @@
                      
          if (usingBatchUpdates)
          {
-            int[] rowsReference = psUpdateReference.executeBatch();
+            int[] rowsReference = updateWithRetryBatch(psUpdateReference);
             
             if (trace)
             {
@@ -1742,11 +1716,11 @@
    {      
       if (tx != null)
       {
-         //In a tx so we just add the ref in the tx in memory for now
+         // We are in a transaction so we just add the ref in the tx in memory for now
 
          TransactionCallback callback = getCallback(tx);
-
          callback.addReferenceToAdd(channelID, ref);
+         if (trace) { log.trace(this + " added " + ref + " to database transactional callback, in transaction: " + tx); }
       }
       else
       {         
@@ -1773,7 +1747,7 @@
             // Add the reference
             addReference(channelID, ref, psReference, true);
             
-            int rows = psReference.executeUpdate();
+            int rows = updateWithRetry(psReference);
             
             if (trace)
             {
@@ -1798,7 +1772,7 @@
                updateMessageChannelCount(m, psMessage);
             }
                            
-            rows = psMessage.executeUpdate();
+            rows = updateWithRetry(psMessage);
             if (trace)
             {
                log.trace("Inserted/updated " + rows + " rows");
@@ -1878,7 +1852,7 @@
          
          psReference.setLong(3, ref.getMessageID());
          
-         int rows = psReference.executeUpdate();                         
+         int rows = updateWithRetry(psReference);                         
       }
       catch (Exception e)
       {
@@ -1946,7 +1920,7 @@
             //Remove the message reference
             removeReference(channelID, ref, psReference);
             
-            int rows = psReference.executeUpdate();
+            int rows = updateWithRetry(psReference);
             
             if (trace)
             {
@@ -1971,7 +1945,7 @@
                updateMessageChannelCount(m, psMessage);
             }
                               
-            rows = psMessage.executeUpdate();
+            rows = updateWithRetry(psMessage);
             
             if (trace)
             {
@@ -2804,6 +2778,8 @@
       //TODO - A slight optimisation - it's possible we have refs referring to the same message
       //so we will end up acquiring the lock more than once which is unnecessary
       //If find unique set of messages can avoid this
+      if (trace) { log.trace("handling before commit 1PC, tx: " + tx);  }
+
       List allRefs = new ArrayList(refsToAdd.size() + refsToRemove.size());
       Iterator iter = refsToAdd.iterator();
       while (iter.hasNext())
@@ -2879,7 +2855,7 @@
             }
             else
             {
-               int rows = psReference.executeUpdate();
+               int rows = updateWithRetry(psReference);
                
                if (trace)
                {
@@ -2934,7 +2910,7 @@
             {
                if (added)
                {
-                  int rows = psInsertMessage.executeUpdate();
+                  int rows = updateWithRetry(psInsertMessage);
                   
                   if (trace)
                   {
@@ -2943,7 +2919,7 @@
                }
                else
                {
-                  int rows = psUpdateMessage.executeUpdate();
+                  int rows = updateWithRetry(psUpdateMessage);
                   
                   if (trace)
                   {
@@ -2959,7 +2935,7 @@
          
          if (batch)
          {
-            int[] rowsReference = psReference.executeBatch();
+            int[] rowsReference = updateWithRetryBatch(psReference);
             
             if (trace)
             {
@@ -2968,7 +2944,7 @@
             
             if (messageInsertsInBatch)
             {
-               int[] rowsMessage = psInsertMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psInsertMessage);
                
                if (trace)
                {
@@ -2977,7 +2953,7 @@
             }
             if (messageUpdatesInBatch)
             {
-               int[] rowsMessage = psUpdateMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psUpdateMessage);
                
                if (trace)
                {
@@ -3028,7 +3004,7 @@
             }
             else
             {
-               int rows = psReference.executeUpdate();
+               int rows = updateWithRetry(psReference);
                
                if (trace)
                {
@@ -3085,7 +3061,7 @@
             {
                if (removed)
                {
-                  int rows = psDeleteMessage.executeUpdate();
+                  int rows = updateWithRetry(psDeleteMessage);
                   
                   if (trace)
                   {
@@ -3094,7 +3070,7 @@
                }
                else
                {
-                  int rows = psUpdateMessage.executeUpdate();
+                  int rows = updateWithRetry(psUpdateMessage);
                   
                   if (trace)
                   {
@@ -3110,7 +3086,7 @@
          
          if (batch)
          {
-            int[] rowsReference = psReference.executeBatch();
+            int[] rowsReference = updateWithRetryBatch(psReference);
             
             if (trace)
             {
@@ -3119,7 +3095,7 @@
             
             if (messageDeletionsInBatch)
             {
-               int[] rowsMessage = psDeleteMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psDeleteMessage);
                
                if (trace)
                {
@@ -3128,7 +3104,7 @@
             }
             if (messageUpdatesInBatch)
             {
-               int[] rowsMessage = psUpdateMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psUpdateMessage);
                
                if (trace)
                {
@@ -3322,7 +3298,7 @@
             {
                if (removed)
                {
-                  int rows = psDeleteMessage.executeUpdate();
+                  int rows = updateWithRetry(psDeleteMessage);
                   
                   if (trace)
                   {
@@ -3331,7 +3307,7 @@
                }
                else
                {
-                  int rows = psUpdateMessage.executeUpdate();
+                  int rows = updateWithRetry(psUpdateMessage);
                   
                   if (trace)
                   {
@@ -3349,7 +3325,7 @@
          {
             if (messageDeletionsInBatch)
             {
-               int[] rows = psDeleteMessage.executeBatch();
+               int[] rows = updateWithRetryBatch(psDeleteMessage);
                
                if (trace)
                {
@@ -3361,7 +3337,7 @@
             }
             if (messageUpdatesInBatch)
             {
-               int[] rows = psUpdateMessage.executeBatch();
+               int[] rows = updateWithRetryBatch(psUpdateMessage);
                
                if (trace)
                {
@@ -3496,7 +3472,7 @@
             }
             else
             {
-               int rows = psReference.executeUpdate();
+               int rows = updateWithRetry(psReference);
                
                if (trace)
                {
@@ -3551,7 +3527,7 @@
             {
                if (added)
                {
-                  int rows = psInsertMessage.executeUpdate();
+                  int rows = updateWithRetry(psInsertMessage);
                   
                   if (trace)
                   {
@@ -3560,7 +3536,7 @@
                }
                else
                {
-                  int rows = psUpdateMessage.executeUpdate();
+                  int rows = updateWithRetry(psUpdateMessage);
                   
                   if (trace)
                   {
@@ -3576,7 +3552,7 @@
          
          if (batch)
          {
-            int[] rowsReference = psReference.executeBatch();
+            int[] rowsReference = updateWithRetryBatch(psReference);
             
             if (trace)
             {
@@ -3585,7 +3561,7 @@
             
             if (messageInsertsInBatch)
             {
-               int[] rowsMessage = psInsertMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psInsertMessage);
                
                if (trace)
                {
@@ -3594,7 +3570,7 @@
             }
             if (messageUpdatesInBatch)
             {
-               int[] rowsMessage = psUpdateMessage.executeBatch();
+               int[] rowsMessage = updateWithRetryBatch(psUpdateMessage);
                
                if (trace)
                {
@@ -3637,7 +3613,7 @@
             }
             else
             {
-               int rows = psReference.executeUpdate();
+               int rows = updateWithRetry(psReference);
                
                if (trace)
                {
@@ -3651,7 +3627,7 @@
          
          if (batch)
          {
-            int[] rows = psReference.executeBatch();
+            int[] rows = updateWithRetryBatch(psReference);
             
             if (trace)
             {
@@ -3821,7 +3797,7 @@
             {
                if (removed)
                {
-                  int rows = psDeleteMessage.executeUpdate();
+                  int rows = updateWithRetry(psDeleteMessage);
                   
                   if (trace)
                   {
@@ -3830,7 +3806,7 @@
                }
                else
                {
-                  int rows = psUpdateMessage.executeUpdate();
+                  int rows = updateWithRetry(psUpdateMessage);
                   
                   if (trace)
                   {
@@ -3848,7 +3824,7 @@
          {
             if (messageDeletionsInBatch)
             {
-               int[] rows = psDeleteMessage.executeBatch();
+               int[] rows = updateWithRetryBatch(psDeleteMessage);
                
                if (trace)
                {
@@ -3860,7 +3836,7 @@
             }
             if (messageUpdatesInBatch)
             {
-               int[] rows = psUpdateMessage.executeBatch();
+               int[] rows = updateWithRetryBatch(psUpdateMessage);
                
                if (trace)
                {
@@ -3952,7 +3928,7 @@
          ps.setInt(3, formatID);
          ps.setBytes(4, xid.getGlobalTransactionId());
 
-         rows = ps.executeUpdate();
+         rows = updateWithRetry(ps);
       }
       finally
       {
@@ -3976,7 +3952,7 @@
       }
    }
    
-   protected void removeTXRecord(Connection conn, Transaction tx) throws SQLException
+   protected void removeTXRecord(Connection conn, Transaction tx) throws Exception
    {
       PreparedStatement ps = null;
       try
@@ -3985,7 +3961,7 @@
          
          ps.setLong(1, tx.getId());
          
-         int rows = ps.executeUpdate();
+         int rows = updateWithRetry(ps);
          
          if (trace)
          {
@@ -4079,7 +4055,7 @@
          
          ps.setLong(1, tx.getId());        
          
-         int rows = ps.executeUpdate();
+         int rows = updateWithRetry(ps);
          
          if (trace)
          {
@@ -4090,7 +4066,7 @@
          ps = conn.prepareStatement(commitMessageRef2);
          ps.setLong(1, tx.getId());         
          
-         rows = ps.executeUpdate();
+         rows = updateWithRetry(ps);
          
          if (trace)
          {
@@ -4125,7 +4101,7 @@
          
          ps.setLong(1, tx.getId());         
          
-         int rows = ps.executeUpdate();
+         int rows = updateWithRetry(ps);
          
          if (trace)
          {
@@ -4137,7 +4113,7 @@
          ps = conn.prepareStatement(rollbackMessageRef2);
          ps.setLong(1, tx.getId());
          
-         rows = ps.executeUpdate();
+         rows = updateWithRetry(ps);
          
          if (trace)
          {
@@ -4511,6 +4487,70 @@
       log.trace("Batch update " + name + ", " + action + " total of " + count + " rows");
    }
    
+   protected int updateWithRetry(PreparedStatement ps) throws Exception
+   {
+      return updateWithRetry(ps, false)[0];
+   }
+   
+   protected int[] updateWithRetryBatch(PreparedStatement ps) throws Exception
+   {
+      return updateWithRetry(ps, true);
+   }
+   
+   private int[] updateWithRetry(PreparedStatement ps, boolean batch) throws Exception
+   {
+      final int MAX_TRIES = 25;      
+      
+      int rows = 0;
+      
+      int[] rowsArr = null;
+      
+      int tries = 0;
+      
+      while (true)
+      {
+         try
+         {
+            if (batch)
+            {
+               rowsArr = ps.executeBatch();
+            }
+            else
+            {
+               rows = ps.executeUpdate();
+            }
+            
+            if (tries > 0)
+            {
+               log.warn("Update worked after retry");
+            }
+            break;
+         }
+         catch (SQLException e)
+         {
+            log.warn("SQLException caught - assuming deadlock detected, try:" + (tries + 1), e);
+            tries++;
+            if (tries == MAX_TRIES)
+            {
+               log.error("Retried " + tries + " times, now giving up");
+               throw new IllegalStateException("Failed to update references");
+            }
+            log.warn("Trying again after a pause");
+            //Now we wait for a random amount of time to minimise risk of deadlock
+            Thread.sleep((long)(Math.random() * 500));
+         }  
+      }
+      
+      if (batch)
+      {
+         return rowsArr;
+      }
+      else
+      {
+         return new int[] { rows };
+      }
+   }
+   
    // Private -------------------------------------------------------
 
    // never access directly

Modified: branches/Branch_1_0/tests/smoke/build.xml
===================================================================
--- branches/Branch_1_0/tests/smoke/build.xml	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/tests/smoke/build.xml	2006-12-03 08:36:09 UTC (rev 1693)
@@ -74,16 +74,28 @@
 
       <!-- 4.0.0, 4.0.1 NOT SUPPORTED -->
 
+      <!--
+           4.0.1sp1
+      -->
+
       <antcall target="installation-test">
          <param name="jboss.home" value="${jboss401sp1.home}"/>
          <param name="run.secure-socket.example" value="false"/>
       </antcall>
 
+      <!--
+           4.0.2
+      -->
+
       <antcall target="installation-test">
          <param name="jboss.home" value="${jboss402.home}"/>
          <param name="run.secure-socket.example" value="false"/>
       </antcall>
 <!--
+      <!--
+           4.0.3
+      -->
+
       <antcall target="installation-test">
          <param name="jboss.home" value="${jboss403.home}"/>
          <param name="run.secure-socket.example" value="false"/>
@@ -94,6 +106,10 @@
          <param name="run.secure-socket.example" value="false"/>
       </antcall>
 -->
+      <!--
+           4.0.3SP1
+      -->
+
       <antcall target="installation-test">
          <param name="jboss.home" value="${jboss403SP1.home}"/>
          <param name="run.secure-socket.example" value="false"/>
@@ -112,6 +128,10 @@
          <param name="run.secure-socket.example" value="false"/>
       </antcall>
 
+      <!--
+           4.0.4.GA
+      -->
+
       <antcall target="installation-test">
          <param name="jboss.home" value="${jboss404GA.home}"/>
       </antcall>
@@ -128,12 +148,20 @@
          <param name="run.secure-socket.example" value="false"/>
       </antcall>
 <!--
+      <!--
+           4.0.5.GA
+      -->
+
       <antcall target="installation-test">
-         <param name="jboss.home" value="${jboss405CR1.home}"/>
+         <param name="jboss.home" value="${jboss405GA.home}"/>
       </antcall>
-
+                                                                                                <!--
       <antcall target="installation-test">
-         <param name="jboss.home" value="${jboss405CR1.home}"/>
+         <param name="jboss.home" value="${jboss405GA-installer.home}"/>
+      </antcall>
+                                                                                                 -->
+      <antcall target="installation-test">
+         <param name="jboss.home" value="${jboss405GA.home}"/>
          <param name="release.admin.target" value="standalone"/>
          <param name="run.mdb.example" value="false"/>
          <param name="run.stateless.example" value="false"/>
@@ -141,7 +169,7 @@
       </antcall>
 
       <antcall target="installation-test">
-         <param name="jboss.home" value="${jboss405CR1ejb3.home}"/>
+         <param name="jboss.home" value="${jboss405GAejb3.home}"/>
          <param name="no.java4" value="true"/>
          <param name="run.ejb3mdb.example" value="true"/>
       </antcall>

Modified: branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_2PCTest.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_2PCTest.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_2PCTest.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -829,6 +829,9 @@
          dels[i].cancel();   
       }
       
+      //Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);
+      
       //This should cause the refs corresponding to the deliveries to go the front of the in memory quuee
       //and the oldest refs in memory evicted off the end into the down cache
       
@@ -862,6 +865,9 @@
          dels[i].cancel();
       }
       
+//    Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);
+      
       //This should cause the down cache to be flushed
       
       //verify 10 ref in storage
@@ -896,6 +902,8 @@
          dels[i].cancel();
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);      
       
       //This should cause the down cache to be flushed
       

Modified: branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_NTTest.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_NTTest.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_NTTest.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -781,6 +781,9 @@
          dels[i].cancel();  
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //This should cause the refs corresponding to the deliveries to go the front of the in memory quuee
       //and the oldest refs in memory evicted off the end into the down cache
       
@@ -814,6 +817,9 @@
          dels[i].cancel();
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //This should cause the down cache to be flushed
       
       //verify 10 ref in storage
@@ -847,6 +853,8 @@
       {
          dels[i].cancel();
       }
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
       
       //consumeCount += 20;
       

Modified: branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_TTest.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_TTest.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_TTest.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -819,6 +819,9 @@
          dels[i].cancel();  
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //This should cause the refs corresponding to the deliveries to go the front of the in memory quuee
       //and the oldest refs in memory evicted off the end into the down cache
       
@@ -852,6 +855,9 @@
          dels[i].cancel();
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //This should cause the down cache to be flushed
       
       //verify 10 ref in storage
@@ -887,6 +893,9 @@
       }
       
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //This should cause the down cache to be flushed
       
       //verify 20 ref in storage

Modified: branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_2PCTest.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_2PCTest.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_2PCTest.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -926,6 +926,9 @@
          dels[i].cancel(); 
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //This should cause the refs corresponding to the deliveries to go the front of the in memory quuee
       //and the oldest refs in memory evicted off the end into the down cache
       
@@ -965,6 +968,9 @@
          dels[i].cancel();
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //This should cause the down cache to be flushed
       
       //verify 10 ref in storage
@@ -1004,6 +1010,9 @@
          dels[i].cancel();
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //consumeCount += 20;
       
       //This should cause the down cache to be flushed

Modified: branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -880,6 +880,9 @@
          dels[i].cancel();
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //This should cause the refs corresponding to the deliveries to go the front of the in memory quuee
       //and the oldest refs in memory evicted off the end into the down cache
       
@@ -918,6 +921,8 @@
       {
          dels[i].cancel();
       }
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
       
       //This should cause the down cache to be flushed
       
@@ -957,6 +962,9 @@
       {
          dels[i].cancel();
       }
+           
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);     
       
       //consumeCount += 20;
       

Modified: branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_TTest.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_TTest.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_TTest.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -913,6 +913,9 @@
          dels[i].cancel();   
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250); 
+      
       //This should cause the refs corresponding to the deliveries to go the front of the in memory quuee
       //and the oldest refs in memory evicted off the end into the down cache
       
@@ -952,6 +955,9 @@
          dels[i].cancel();
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //This should cause the down cache to be flushed
       
       //verify 10 ref in storage
@@ -991,6 +997,9 @@
          dels[i].cancel();
       }
       
+      // Cancel is asynch, so need to wait a bit
+      Thread.sleep(250);       
+      
       //consumeCount += 20;
       
       //This should cause the down cache to be flushed

Modified: branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/JMSTest.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/JMSTest.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/JMSTest.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -194,6 +194,45 @@
       conn.close();
    }
 
+   public void test_Persistent_Transactional_Send() throws Exception
+   {
+      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+
+      Queue queue = (Queue)ic.lookup("/queue/JMSTestQueue");
+
+      Connection conn = cf.createConnection();
+
+      Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
+
+      MessageProducer prod = session.createProducer(queue);
+      prod.setDeliveryMode(DeliveryMode.PERSISTENT);
+
+      TextMessage m = session.createTextMessage("message one");
+      prod.send(m);
+      m = session.createTextMessage("message two");
+      prod.send(m);
+
+      session.commit();
+
+      conn.close();
+
+      conn = cf.createConnection();
+
+      session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      MessageConsumer cons = session.createConsumer(queue);
+
+      conn.start();
+
+      TextMessage rm = (TextMessage)cons.receive();
+      assertEquals("message one", rm.getText());
+      rm = (TextMessage)cons.receive();
+      assertEquals("message two", rm.getText());
+
+      conn.close();
+   }
+
+
    public void test_NonPersistent_Transactional_Acknowledgment() throws Exception
    {
       ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
@@ -227,7 +266,6 @@
       conn.close();
    }
 
-
    public void test_Asynchronous_to_Client() throws Exception
    {
       ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");

Modified: branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/MessageConsumerTest.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/MessageConsumerTest.java	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/MessageConsumerTest.java	2006-12-03 08:36:09 UTC (rev 1693)
@@ -895,6 +895,9 @@
 
           cons1.close();
           
+          //Cancelling is asynch so can take some time
+          Thread.sleep(500);
+          
           //rollback should cause redelivery of messages
 
           //in this case redelivery occurs to a different receiver
@@ -1009,6 +1012,9 @@
           assertEquals("hello1", rm1.getText());
 
           cons1.close();
+          
+          //Give time for asynch cancel to happen
+          Thread.sleep(500);
          
           log.debug("sess.recover()");
 

Copied: branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/stress/ConcurrentCloseStressTest.java (from rev 1692, branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/stress/ConcurrentCloseStressTest.java)

Modified: branches/Branch_1_0/util/do-not-distribute.properties
===================================================================
--- branches/Branch_1_0/util/do-not-distribute.properties	2006-12-03 07:55:29 UTC (rev 1692)
+++ branches/Branch_1_0/util/do-not-distribute.properties	2006-12-03 08:36:09 UTC (rev 1693)
@@ -6,7 +6,7 @@
 #jboss.home=C:\\work/src/cvs/jboss-head/build/output/jboss-5.0.0.Alpha
 #jboss.home=C:\\work\\src\\jboss-4.0.3SP1-src\\build\\output\\jboss-4.0.3SP1
 jboss.home=C:\\work\\src\\jboss-4.0.4.GA-src\\build\\output\\jboss-4.0.4.GA
-#jboss.home=C:\\work\\src\\jboss-4.0.5.CR1-src\\build\\output\\jboss-4.0.5.CR1-ejb3
+jboss.home=C:\\work\\src\\jboss-4.0.5.GA-src\\build\\output\\jboss-4.0.5.GA-ejb3
 messaging.config.name=messaging
 relative.artifact.location=../output/lib
 messaging.artifact.name=jboss-messaging-scoped.sar




More information about the jboss-cvs-commits mailing list