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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Jan 12 05:27:31 EST 2008


Author: timfox
Date: 2008-01-12 05:27:31 -0500 (Sat, 12 Jan 2008)
New Revision: 3560

Modified:
   branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-1218


Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java	2008-01-11 15:01:59 UTC (rev 3559)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java	2008-01-12 10:27:31 UTC (rev 3560)
@@ -180,11 +180,14 @@
 
             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
@@ -210,14 +213,8 @@
             }
             finally
             {
-               try
-               {
-                  rset.close();
-                  selectCount.close();
-               }
-               catch (Throwable ignored)
-               {
-               }
+               closeResultSet(rset);
+               closeStatement(selectCount);
             }
          }
       }
@@ -938,6 +935,8 @@
          {
             maxOrdering = null;
          }
+         
+         rs.close();
 
          ps.close();
 
@@ -978,6 +977,7 @@
          {
             // Take any overflow and convert them to paged refs
 
+            rs.close();
             ps.close();
             ps = conn.prepareStatement(getSQLStatement("UPDATE_PAGE_ORDER"));
 
@@ -1584,8 +1584,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