persistence@glassfish.java.net

Re: Storing EntityManager in a session.

From: Adam Bien <abien_at_adam-bien.com>
Date: Tue, 05 Feb 2008 14:29:28 +0100

Wouter van Reeven schrieb:
> On Mon, Feb 04, 2008 at 11:17:40PM -0800, lvcster wrote:
>
>> The assumption is right, it is the HTTP session without JSF. I just wanted to
>> try it with just plain JSP,J2EE, and as I said I don't want to use any
>> Beans.
>>
>
> If you mean you don't want to use any JSF (managed or backing) beans, then you
> might consider either using servlets or struts action classes. In either case
> you can do the same thing as was suggested earlier: get hold of the HttpSession
> object and store the EM on it.
>
>
> HTH, Wouter
>
>
...and make sure, that every transaction-handling, concurrency and EM
management are handled correctly :-).
Which is almost mission impossible, or at least harder, than a single
Session Beans as a facade.
In the latter case the container would manage everything for you.

regards,

adam

-- 
 Consultant, Author, Java Champion
 
 Homepage: www.adam-bien.com
 Weblog: blog.adam-bien.com
 eMail:  abien_at_adam-bien.com
 Mobile: 0049(0)170 280 3144
 Books: Enterprise Architekturen (ISBN: 393504299X),
        Java EE 5 Architekturen  (ISBN: 3939084247),
        J2EE Patterns, J2EE Hotspots, Enterprise Frameworks and Struts