tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Hanik \(lists\)" <devli...@hanik.com>
Subject RE: Session replication
Date Thu, 01 Apr 2004 16:24:15 GMT
it should be compatible, I wrote that article so long ago, that I am not
sure what is in that code base anymore :)

Filip

-----Original Message-----
From: Vijay Kandy [mailto:VijayK@mailcode.com]
Sent: Thursday, April 01, 2004 10:15 AM
To: 'Tomcat Users List'
Subject: RE: Session replication


Hi Filip,

I am using JavaGroups-2.0.jar...is 2.0 not compatible with Tomcat 4.1.24?
Thanks for the good software and the docs
(http://www.theserverside.com/articles/article.tss?l=Tomcat) !!

Regards,
Vijay Kandy

-----Original Message-----
From: Filip Hanik (lists) [mailto:devlists@hanik.com]
Sent: Thursday, April 01, 2004 11:03 AM
To: Tomcat Users List
Subject: RE: Session replication


hi Vijay,
sorry to let you know that I don't have bandwidth to support session
replication on Tomcat 4 as it was not part of the official release

The latest code base is at
http://cvs.apache.org/~fhanik/

is that what you are using?

Filip

-----Original Message-----
From: Vijay Kandy [mailto:VijayK@mailcode.com]
Sent: Thursday, April 01, 2004 9:51 AM
To: 'Tomcat Users List'
Subject: Session replication


Hello,

This may seem trivial to most of you but I bet this will help learner like
me so heres my question. I use the following method to validate a http
session. I have 2 instance of Tomcat 4.1.24 + mod_jk + Apache2 that
replicate session in-memory (JavaGroups stuff). After I deliberately
shutdown one instance, I see that requests to the other instance but while
validating sessions I go to the line where I put block comments ("I get to
this line on Node 2 ...") and eventually invalidate() them. Why does
session.isNew() return true on the second instance?


private boolean isValidSession(HttpServletRequest request,
HttpServletResponse response)
{
	try
 	{
 		HttpSession session = request.getSession(true);
		if( ! session.isNew() )
		{
			if( session != null )
			{
				Hashtable sessionStuff =
(Hashtable)session.getAttribute("someSessionStuff");

				try
				{
					// Do something with "sessionStuff"
...
				}
				catch(Exception exp)
				{

session.removeAttribute("sessionStuff");
					session.invalidate();
					return false;
				}
			}
			else
			{
				session.invalidate();
				return false;
			}
		}
		else
		{
			/**************************************
			 * I get to this line on Node 2 ...
			 **************************************/
			session.invalidate();
			return false;
		}
	}
	catch(Exception e)
	{
		e.printStackTrace();
	}

	return true;
}

Regards,
Vijay Kandy

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.614 / Virus Database: 393 - Release Date: 3/5/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.614 / Virus Database: 393 - Release Date: 3/5/2004


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.614 / Virus Database: 393 - Release Date: 3/5/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.614 / Virus Database: 393 - Release Date: 3/5/2004


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message