[jboss-cvs] JBoss Messaging SVN: r3652 - branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 31 05:33:39 EST 2008


Author: timfox
Date: 2008-01-31 05:33:38 -0500 (Thu, 31 Jan 2008)
New Revision: 3652

Modified:
   branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
Log:
Applied http://jira.jboss.org/jira/browse/JBMESSAGING-1218 for EAP CP


Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java	2008-01-31 09:47:03 UTC (rev 3651)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java	2008-01-31 10:33:38 UTC (rev 3652)
@@ -180,11 +180,13 @@
 
             log.debug("Checking for existance on JBM_DUAL");
 
-            Statement selectCount = conn.createStatement();
-            ResultSet rset = selectCount.executeQuery(this
-                  .getSQLStatement("CHECK_DUAL"));
+            Statement selectCount = null;
+            ResultSet rset = null;
             try
             {
+               selectCount = conn.createStatement();
+               rset = selectCount.executeQuery(this.getSQLStatement("CHECK_DUAL"));
+               
                // if JBM_DUAL is empty, and if an exception happened, we should
                // warn!
                // if JBM_DUAL has a line already, we don't care about the
@@ -212,8 +214,8 @@
             {
                try
                {
-                  rset.close();
-                  selectCount.close();
+                  closeResultSet(rset);
+                  closeStatement(selectCount);
                }
                catch (Throwable ignored)
                {
@@ -939,6 +941,8 @@
             maxOrdering = null;
          }
 
+         rs.close();
+         
          ps.close();
 
          ps = conn.prepareStatement(getSQLStatement("LOAD_UNPAGED_REFS"));
@@ -1584,8 +1588,11 @@
                   ChannelRefPair pair = (ChannelRefPair) i.next();
                   MessageReference ref = pair.ref;
 
-                  psReference = conn
-                        .prepareStatement(getSQLStatement("INSERT_MESSAGE_REF"));
+                  if (psReference == null)
+                  {
+                     psReference = conn
+                           .prepareStatement(getSQLStatement("INSERT_MESSAGE_REF"));
+                  }
 
                   // Now store the reference
                   addReference(pair.channelID, ref, psReference, false);




More information about the jboss-cvs-commits mailing list