You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Duffy <md...@yahoo.com> on 2004/04/12 05:53:15 UTC

RE: Clustering Application Scope Objects

>>>how would you solve conflicts?

For my purposes, I would let the database manage conflicts.  Each application scope object would
be tied to the database, a change made on a specific application server would first update the
database.  For example, the information from a table containing label/value pairs for product
categories would be stored in application scope on each server at system startup.  If a change
were made to the product categories, the change would first made to the database and then a change
notification would be broadcast to all servers in the cluster, each server would then reload the
information from the database.

In other cases, where application scoped objects are not backed by a database, the task of
handling conflicts becomes more difficult.  I think you would almost need to create some sort of
locking mechanism that does not allow changes to be made during an update.

Mike


--- "Filip Hanik (lists)" <de...@hanik.com> wrote:
> not implemented right now, how would you solve conflicts?
> 
> 
> 
> Filip
> 
> -----Original Message-----
> From: Mike Duffy [mailto:mduffy_lists@yahoo.com]
> Sent: Friday, April 09, 2004 5:48 PM
> To: Tomcat Users List
> Subject: Clustering Application Scope Objects
> 
> 
> I've read documentation for The Tomcat 5 Servlet/JSP Container:
> Clustering/Session Replication HOW-TO
> http://jakarta.apache.org/tomcat/tomcat-5.0-doc/cluster-howto.html
> 
> I understand clustering for individual user sessions.  Are there any
> correlated methods for
> clustering application scope objects?
> 
> The J2EE API for the Interface ServletContext states, "In the case of a web
> application marked
> "distributed" in its deployment descriptor, there will be one context
> instance for each virtual
> machine. In this situation, the context cannot be used as a location to
> share global information
> (because the information won't be truly global). Use an external resource
> like a database
> instead."
> 
> Rather than use a database, what I would like to be able to do is make a
> call to
> 
>     servlet.getServletContext().setAttribute(key, object);
> 
> and have the object stored in the application scope of all servers in the
> cluster.
> 
> I know that EJBs were designed to serve this purpose; however, I would like
> to bypass the overhead
> and complexities of EJBs.
> 
> If there isn't a switch that can be flipped in Tomcat, there might be a way
> to create a
> lightweight JMS administration class to serve this purpose.  Has anyone
> tried this?
> 
> If the answer to this question is RTFM, please send a link; I've looked
> through the documentation
> and I can't seem to find a clear reference.
> 
> Thanks for your time and consideration.
> 
> Mike
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business $15K Web Design Giveaway
> http://promotions.yahoo.com/design_giveaway/
> 
> ---------------------------------------------------------------------
> 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.654 / Virus Database: 419 - Release Date: 4/6/2004
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.654 / Virus Database: 419 - Release Date: 4/6/2004
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


	
		
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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


Re: Clustering Application Scope Objects

Posted by Sergiusz Jarczyk <se...@qresc.com>.
Hi

> For my purposes, I would let the database manage conflicts.  Each
application scope object would
> be tied to the database, a change made on a specific application server
would first update the
> database.  For example, the information from a table containing
label/value pairs for product
> categories would be stored in application scope on each server at system
startup.  If a change
> were made to the product categories, the change would first made to the
database and then a change
> notification would be broadcast to all servers in the cluster, each server
would then reload the
> information from the database.
>

I'm not sure how often your data MAY change, but looking at the above
explanation, why don't you
simply use small piece of code for checking data stored in the database? You
can add a column with
timestamps, which can be checked, for example, every five minutes. I know
it's not too elegant
solution, but I'm sure it saves you the overhead, added by JMS-based
solution.

Sergiusz


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