[Jboss-cvs] JBossAS SVN: r56323 - branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun Aug 27 23:41:54 EDT 2006
Author: bstansberry at jboss.com
Date: 2006-08-27 23:41:53 -0400 (Sun, 27 Aug 2006)
New Revision: 56323
Modified:
branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java
Log:
Simplify the way we ignore cache notifications from webapp threads; session id isn't relevant
Pass the session itself to the SnapshotManager
Specially track expired sessions
Modified: branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java
===================================================================
--- branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java 2006-08-28 03:41:21 UTC (rev 56322)
+++ branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java 2006-08-28 03:41:53 UTC (rev 56323)
@@ -613,9 +613,7 @@
createdCounter_++;
// Add this session to the set of those potentially needing replication
- // We use the realId here
- String realId = getRealId(sessionId);
- SessionReplicationContext.bindSession(realId, snapshotManager_);
+ SessionReplicationContext.bindSession(session, snapshotManager_);
return session;
}
@@ -623,7 +621,7 @@
public boolean storeSession(Session baseSession)
{
boolean stored = false;
- if(baseSession != null)
+ if(baseSession != null && started_)
{
ClusteredSession session = (ClusteredSession) baseSession;
@@ -776,7 +774,7 @@
// session from the other nodes to be gravitated, thus resuscitating
// the session.
if (session == null
- && !SessionReplicationContext.isSessionBound(realId, snapshotManager_))
+ && !SessionReplicationContext.isSessionBoundAndExpired(realId, snapshotManager_))
{
if (log_.isTraceEnabled())
log_.trace("Checking for session " + realId + " in the distributed cache");
@@ -801,7 +799,7 @@
if (session != null)
{
// Add this session to the set of those potentially needing replication
- SessionReplicationContext.bindSession(realId, snapshotManager_);
+ SessionReplicationContext.bindSession(session, snapshotManager_);
}
return session;
@@ -895,7 +893,7 @@
try {
// Ignore any cache notifications that our own work generates
- SessionReplicationContext.startLocalActivity(realId);
+ SessionReplicationContext.startLocalActivity();
clusterSess.removeMyself();
}
finally {
@@ -903,7 +901,7 @@
// We don't want to replicate this session at the end
// of the request; the removal process took care of that
- SessionReplicationContext.unbindSession(realId, snapshotManager_);
+ SessionReplicationContext.sessionExpired(clusterSess, realId, snapshotManager_);
sessions_.remove(realId);
stats_.removeStats(realId);
@@ -933,7 +931,7 @@
try {
// Ignore any cache notifications that our own work generates
- SessionReplicationContext.startLocalActivity(realId);
+ SessionReplicationContext.startLocalActivity();
clusterSess.removeMyselfLocal();
}
finally
@@ -942,7 +940,7 @@
// We don't want to replicate this session at the end
// of the request; the removal process took care of that
- SessionReplicationContext.unbindSession(realId, snapshotManager_);
+ SessionReplicationContext.sessionExpired(clusterSess, realId, snapshotManager_);
sessions_.remove(realId);
stats_.removeStats(realId);
@@ -1004,7 +1002,7 @@
// Ignore cache notifications we may generate for this
// session if data gravitation occurs.
- SessionReplicationContext.startLocalActivity(realId);
+ SessionReplicationContext.startLocalActivity();
session = proxy_.loadSession(realId, session);
}
@@ -1075,7 +1073,6 @@
// for a single put
boolean notSession = (replicationGranularity_ != WebMetaData.REPLICATION_GRANULARITY_SESSION);
boolean doTx = false;
- String realId = session.getRealId();
try
{
// We need transaction so all the replication are sent in batch.
@@ -1092,7 +1089,7 @@
// at this level because we don't want to resume handling
// notifications until any compensating changes resulting
// from a tx rollback are done.
- SessionReplicationContext.startLocalActivity(realId);
+ SessionReplicationContext.startLocalActivity();
session.processSessionRepl();
}
More information about the jboss-cvs-commits
mailing list