You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by evan rawson <dj...@yahoo.com> on 2005/11/18 01:10:58 UTC
Sharing an HTTPSession Between Apps
Hiya we have a quite large tapestry application we are devolping and was wondering if and how we could share httpsession data between tapestry applications. Just looking for someplaces to look into. The best bet i think we have researched up is the RedirectException Class.
much help would be appreciated
thanx alot
evan
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
Re: Sharing an HTTPSession Between Apps
Posted by Todd Orr <to...@gmail.com>.
Having an in-memory database limits you to one JVM. You can just as easily
use a real db for this task.
We have solved this problem a long time ago using the database session
approach. However, based on experience with our highly concurrent system,
you should store as little as possible in this table. We store a randomly
generated "session" token that gets mirrored in the server and client
cookies. There is also a small amount of misc data like user id and server,
etc.
We use this approach for handling load balances, single sign-ons, and server
crashes. We have had very good results. Of course, this is not as performant
as an in memory session and newer clustering technologies are under
evaluation at my company, but the db approach is tried and true, and can be
made very fast. It will come down to the hardware you can afford.
Note: if your system will be highly concurrent, you must absolutely ensure
that indexes are properly setup on your table and that queries against this
table are managed. The last thing you want is to have somebody foolishly
join to this table in a multi-join query and lock it. We've also had this
happen when we were working the kinks out. Be careful. There's nothing like
a blocking query to make your highly concurrent system grind to a halt. This
problem is not always obvious, especially when the details are masked from
your developers by an ORM.
On 11/20/05, Richard Clark <rd...@nextquestion.net> wrote:
>
> I've done something similar to this in Tapestry 3.
>
> Let's say you have two apps: Catalog and Checkout, and that the user
> is always sent to Catalog first. Catalog would then assign a "working
> user ID", and dump its state to the database under that ID. When it's
> time to go to the Checkout, use the External service to construct a
> link with the working user ID and a full path to the Checkout
> application. You can then make that a clickable link or redirect to
> it -- the single redirection would contain the one think you need
> (the working user ID) to pull info up from the database.
>
> If the apps need to do more concurrent communication, Java RMI is a
> possibility, but I suspect you don't need quite that much back-and-
> forth.
>
> ...Richard
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
Re: Sharing an HTTPSession Between Apps
Posted by Richard Clark <rd...@nextquestion.net>.
I've done something similar to this in Tapestry 3.
Let's say you have two apps: Catalog and Checkout, and that the user
is always sent to Catalog first. Catalog would then assign a "working
user ID", and dump its state to the database under that ID. When it's
time to go to the Checkout, use the External service to construct a
link with the working user ID and a full path to the Checkout
application. You can then make that a clickable link or redirect to
it -- the single redirection would contain the one think you need
(the working user ID) to pull info up from the database.
If the apps need to do more concurrent communication, Java RMI is a
possibility, but I suspect you don't need quite that much back-and-
forth.
...Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Sharing an HTTPSession Between Apps
Posted by evan rawson <dj...@yahoo.com>.
that sounds like a doable solution as, when i researched more into the redirects indeed it seems really messy, my only question about passing the information into a temp DB, would be how could we refrence between two sessions to share the stored data. Doesn't each session have a unique ID?
a lil more about our project. Its a large scale ecommerce site, that will have many thousand concurrent users, i think having a DB that is in-memory only would not create a bottle neck issue, as that seems equilivant to passing system messages, since the data is being kept in the RAM neways.
again my only concern is how we can link up the sessions within that DB.
thanx alot for the advice
evan rawson
Richard Clark <rd...@nextquestion.net> wrote:
On Nov 17, 2005, at 16:10, evan rawson wrote:
> Hiya we have a quite large tapestry application we are developing
> and was wondering if and how we could share httpsession data
> between tapestry applications.
I would extract the data and stuff it into a common database that is
then accessed by the two applications. You could use Hibernate SQL in
its "in-memory" configuration if you needed speed and don't need to
hold the data across a restart.
Trying to pass data back and forth using a RedirectException sounds
messy, and all those redirections will slow down the application.
...Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
Re: Sharing an HTTPSession Between Apps
Posted by Richard Clark <rd...@nextquestion.net>.
On Nov 17, 2005, at 16:10, evan rawson wrote:
> Hiya we have a quite large tapestry application we are developing
> and was wondering if and how we could share httpsession data
> between tapestry applications.
I would extract the data and stuff it into a common database that is
then accessed by the two applications. You could use Hibernate SQL in
its "in-memory" configuration if you needed speed and don't need to
hold the data across a restart.
Trying to pass data back and forth using a RedirectException sounds
messy, and all those redirections will slow down the application.
...Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org