[jboss-cvs] JBoss Messaging SVN: r8273 - in branches/Branch_1_4/src/main/org/jboss: messaging/core/impl and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Apr 20 09:32:49 EDT 2011
Author: gaohoward
Date: 2011-04-20 09:32:49 -0400 (Wed, 20 Apr 2011)
New Revision: 8273
Modified:
branches/Branch_1_4/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java
branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/JDBCSupport.java
Log:
JBMESSAGING-1859
Modified: branches/Branch_1_4/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java 2011-04-18 21:56:57 UTC (rev 8272)
+++ branches/Branch_1_4/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java 2011-04-20 13:32:49 UTC (rev 8273)
@@ -61,8 +61,16 @@
private static ReadWriteLock invokeLock;
+ private static volatile boolean closing = false;
+
+ public static boolean isClosing()
+ {
+ return closing;
+ }
+
public static void setClosed(boolean b)
{
+ closing = b;
try
{
invokeLock.writeLock().acquire();
Modified: branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/JDBCSupport.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/JDBCSupport.java 2011-04-18 21:56:57 UTC (rev 8272)
+++ branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/JDBCSupport.java 2011-04-20 13:32:49 UTC (rev 8273)
@@ -21,6 +21,7 @@
*/
package org.jboss.messaging.core.impl;
+import org.jboss.jms.server.remoting.JMSServerInvocationHandler;
import org.jboss.logging.Logger;
import org.jboss.messaging.core.contract.MessagingComponent;
@@ -417,6 +418,13 @@
log.error("Retried " + retries + " times reconnection, now giving up", e);
throw new IllegalStateException("Failed to get connection");
}
+
+ if (JMSServerInvocationHandler.isClosing())
+ {
+ log.warn(this + " Stopped, give up getting connection, autoCommit " + autoCommit);
+ throw new IllegalStateException("Failed to get connection");
+ }
+
retries++;
log.warn("Trying reconnection again after a pause of " + retryInterval + " ms.");
@@ -454,6 +462,13 @@
log.error("Retried " + retries + " times reconnection, now giving up", e);
throw new IllegalStateException("Failed to get connection");
}
+
+ if ( JMSServerInvocationHandler.isClosing())
+ {
+ log.warn(this + " Stopped, give up getting connection.");
+ throw new IllegalStateException("Failed to get connection");
+ }
+
retries++;
log.warn("Trying reconnection again after a pause of " + retryInterval + " ms.");
More information about the jboss-cvs-commits
mailing list