aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes HTTP Session Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "HTTP Session Object" Watch "HTTP Session Object" New topic
Author

HTTP Session Object

Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi,

Can two applications deployed in the same application server, with different nodes can able to share the session objects?

Regards,
M.S.Raman
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30973
    
159

Malli,
No. The spec prevents session object sharing.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Question & Question form JGuru.com

What servlet engines support clustering -- that is, sharing of session data across multiple load-balanced web servers?


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by Malli Raman:
Hi,

Can two applications deployed in the same application server, with different nodes can able to share the session objects?

Regards,
M.S.Raman



If you want share why not store in database.


Groovy
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi Pradeep,

From one application (link is provided) to open another application and both applications are deployed in different nodes of the same app server. First application stores the user information in session object which the second application wants to use. Is it possible?

Regards,
M.S.Raman
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Malli Raman:
Hi Pradeep,

From one application (link is provided) to open another application and both applications are deployed in different nodes of the same app server. First application stores the user information in session object which the second application wants to use. Is it possible?

Regards,
M.S.Raman



I think, you can use Single-Sign-On System for solve this problem.

Reference Website
http://www.theserverside.com/news/thread.tss?thread_id=25652
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Originally posted by Malli Raman:
Hi Pradeep,

From one application (link is provided) to open another application and both applications are deployed in different nodes of the same app server. First application stores the user information in session object which the second application wants to use. Is it possible?

Regards,
M.S.Raman



Moreover since both application is going to deployed in the same server /jvm i think the session objects will be stored in the same memory. If that's the case I think we can use this option. (I haven't tried this one).

-Raman
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

From one application (link is provided) to open another application and both applications are deployed in different nodes of the same app server. First application stores the user information in session object which the second application wants to use. Is it possible?


Well,it is not.
You could persist the user details (present in session of first m/c) in the database. Pass the id of the user as parameter in the URL. The 2nd m/c now receives the id and serches in the database and retrives the user info.
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
In such case, the application itself must keep trace of access record, otherwise, it may not know there are 2 sessions accessing it, rite?

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Originally posted by Pradeep Bhat:


Well,it is not.
You could persist the user details (present in session of first m/c) in the database. Pass the id of the user as parameter in the URL. The 2nd m/c now receives the id and serches in the database and retrives the user info.


Thanks Pradeep. I agree with you and I am thinking about other possible solution so that i don't need to touch the first application

Regards,
M.S.Raman
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HTTP Session Object