[jboss-cvs] JBossAS SVN: r61581 - branches/Branch_4_2/messaging/src/main/org/jboss/mq/pm/jdbc2.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 22 11:11:57 EDT 2007


Author: adrian at jboss.org
Date: 2007-03-22 11:11:57 -0400 (Thu, 22 Mar 2007)
New Revision: 61581

Modified:
   branches/Branch_4_2/messaging/src/main/org/jboss/mq/pm/jdbc2/PersistenceManager.java
Log:
[JBAS-3792] - Include FAQ explanation in the error message for missing messages in JBossMQ database.

Modified: branches/Branch_4_2/messaging/src/main/org/jboss/mq/pm/jdbc2/PersistenceManager.java
===================================================================
--- branches/Branch_4_2/messaging/src/main/org/jboss/mq/pm/jdbc2/PersistenceManager.java	2007-03-22 15:11:08 UTC (rev 61580)
+++ branches/Branch_4_2/messaging/src/main/org/jboss/mq/pm/jdbc2/PersistenceManager.java	2007-03-22 15:11:57 UTC (rev 61581)
@@ -63,6 +63,7 @@
 import org.jboss.system.ServiceMBeanSupport;
 import org.jboss.tm.TransactionManagerService;
 import org.jboss.tm.TransactionTimeoutConfiguration;
+import org.jboss.util.UnreachableStatementException;
 
 import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
 
@@ -78,7 +79,9 @@
 public class PersistenceManager extends ServiceMBeanSupport
    implements PersistenceManagerMBean, org.jboss.mq.pm.PersistenceManager, CacheStore
 {
-
+   /** FAQ about concurrency problems */
+   private static String CONCURRENCY_WARNING = "\nCommon reasons for missing messages are \n1) You have multiple JBossMQs running over the same database.\n2) You are using a replicating database that is not keeping up with replication.";
+   
    /////////////////////////////////////////////////////////////////////////////////
    //
    // TX state attibutes
@@ -1404,7 +1407,7 @@
                    {
                       if (rc != 1)
                          throw new SpyJMSException(
-                           "Could not mark the message as deleted in the database: update affected " + rc + " rows");
+                           "Could not mark the message as deleted in the database: update affected " + rc + " rows." + CONCURRENCY_WARNING);
 
                       log.warn("Remove operation worked after " +tries +" retries");
                    }
@@ -1499,20 +1502,16 @@
          rs = stmt.executeQuery();
          if (rs.next())
             return extractMessage(rs);
+         else
+            throw new SpyJMSException("Could not load message from storage: " + messageRef + " " + CONCURRENCY_WARNING);
 
-         return null;
-
       }
-      catch (IOException e)
+      catch (Exception e)
       {
          tms.setRollbackOnly();
-         throw new SpyJMSException("Could not load message : " + messageRef, e);
+         SpyJMSException.rethrowAsJMSException("Could not load message : " + messageRef, e);
+         throw new UnreachableStatementException();
       }
-      catch (SQLException e)
-      {
-         tms.setRollbackOnly();
-         throw new SpyJMSException("Could not load message : " + messageRef, e);
-      }
       finally
       {
          try
@@ -1670,6 +1669,7 @@
     * connection.  We, therefore, implement a retry loop wich is controled
     * by the ConnectionRetryAttempts attribute.  Submitted by terry at amicas.com
     *
+    * @return the connection
     * @exception SQLException if an error occurs.
     */
    protected Connection getConnection() throws SQLException




More information about the jboss-cvs-commits mailing list