[jboss-cvs] JBossAS SVN: r72163 - trunk/connector/src/main/org/jboss/resource/adapter/jms/inflow.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Apr 14 07:01:13 EDT 2008
Author: adrian at jboss.org
Date: 2008-04-14 07:01:13 -0400 (Mon, 14 Apr 2008)
New Revision: 72163
Modified:
trunk/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsServerSessionPool.java
Log:
[JBAS-5428] - Fix the session pool shutdown
Modified: trunk/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsServerSessionPool.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsServerSessionPool.java 2008-04-14 11:00:59 UTC (rev 72162)
+++ trunk/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsServerSessionPool.java 2008-04-14 11:01:13 UTC (rev 72163)
@@ -138,7 +138,6 @@
}
catch (Throwable t)
{
- log.error("Unable to get a server session", t);
throw new JMSException("Unable to get a server session " + t);
}
@@ -215,9 +214,9 @@
{
JmsServerSession session = (JmsServerSession) serverSessions.get(i);
session.teardown();
+ --sessionCount;
}
- sessionCount -= serverSessions.size();
serverSessions.clear();
if (activation.getActivationSpec().isForceClearOnShutdown())
@@ -226,19 +225,23 @@
int forceClearAttempts = activation.getActivationSpec().getForceClearAttempts();
long forceClearInterval = activation.getActivationSpec().getForceClearOnShutdownInterval();
- log.info("Force clear behavior in effect. Waiting for " + forceClearInterval + " milliseconds for " + forceClearAttempts + " attempts.");
+ log.trace(this + " force clear behavior in effect. Waiting for " + forceClearInterval + " milliseconds for " + forceClearAttempts + " attempts.");
while((sessionCount > 0) && (attempts < forceClearAttempts))
{
try
{
+ int currentSessions = sessionCount;
serverSessions.wait(forceClearInterval);
- log.trace("Clear attempt " + attempts);
- ++attempts;
-
- }catch(InterruptedException ignore)
+ // Number of session didn't change
+ if (sessionCount == currentSessions)
+ {
+ ++attempts;
+ log.trace(this + " clear attempt failed " + attempts);
+ }
+ }
+ catch(InterruptedException ignore)
{
-
}
}
More information about the jboss-cvs-commits
mailing list