There is no expiration date on home or remote or local interfaces so as long as the session survives (sessions can expire) so will session bound objects. Provided you catch all the appropriate exceptions this seems fine. Consider hiding the lookup and caching the intitial context such as Rafal suggests in his pattern reference. It seems a bit of a stretch to call that a pattern as Sun is doing; it's an application of lazy loading and caching of objects. We use a session "payload" object and stuff it with references to objects required for that user's use case and then toss it once the use case is complete. This is combined with a central lookup factory that I use during the population of a payload. That way you have one "thing" to track per session: the payload.
-----Original Message-----
From: Russell Black [mailto:[EMAIL PROTECTED]
Sent: Sat 3/15/2003 8:53 PM
To: [EMAIL PROTECTED]
Cc:
Subject: [JBoss-user] Can I store a Local Entity Bean in my HttpSession?
Can I store a Local Entity Bean in my HttpSession? That is, will it be valid
on subsequent requests?
Something like this?
session.setAttribute("foo", beanLocalHome.findByPrimaryKey(key));
Thanks,
Russell
<<winmail.dat>>
