tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: dirty data and session management....
Date Thu, 04 Mar 2004 14:04:12 GMT

Hi,

>This may be more of a design question, but I'm
>wondering if tomcat has anything in it's API that we
>might be able to leverage to help manage dirty data in
>a user's session?
>When our user's login, we load, into their session a
>w3c dom document that contains user-information, etc.
>We use xsl transforms for display, so we overload that
>session-based w3c dom w/ information necessary to show
>the page to the user (any name value pair that could
>have been read from the dB, say "roles")
>So, User-1 is editing the roles.  We read from the db,
>the id/name for each role, tack it into the session
>XML and transform it on the XSL to display to the
>user.
>User-2 does the same thing.  User-1 edits some of the
>role names and submits.
>User-2 does the same thing, thus making User-1's role
>information dirty.
>Is there a way (using some API or tomcat) to enforce
>that User-2's submit cannot take place w/o them
>re-reading those roles b/c User-1 already committed?

What you would likely do is a two-pronged approach:
- Have a POJO that talks to the DB, performs updates, reads, etc.
- Have an HttpSessionListener that keeps track of your sessions and is
notified by the POJO when the DB data changes.  This session listener,
upon notification, can crawl through the sessions and
nullify/regenerate/whatever you want to with the dirty data.

The above approach is fairly generic, but not the most efficient in the
world.

Yoav Shapira 



This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
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