On Mon, 07 May 2012 10:08:40 -0300, Arno Haase <arno.ha...@haase-consulting.com> wrote:

I know the mechanics of @Persist and Session State. But I am looking
for advice on how to deal with some common challenges using Tapestry:

* Let's say a page stores stuff in the HttpSession using @Persist -
directly or e.g. through use of the Grid component. Whenever a user
opens that page twice in different browser tabs, those two instances
share server side state, and sorting one of the grids by name can
affect the other.

Tapestry itself doesn't provide a solution for this kind of problem, but tapestry-conversations from the Tynamo project does: http://docs.codehaus.org/display/TYNAMO/tapestry-conversations+guide.

* There can be (rare but tricky) race conditions if two AJAX calls are
fired concurrently and operate on session data - all of a sudden there
is multithreaded logic in the server.

If you do have something that could have a problem with multiple calls for the same data, there's no good-for-all-scenarios solution possible. You can use a service to do this shared data access and does the appropriate threading logic.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to