Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Safe to story entity in a web session obtained from @PersistenceContext ?

I've noticed that too, but I've also noticed that lazy init via JSP
seems to work, wouldn't the transaction boundary be over and the
entity be detached by then?

./tch



On Wed, Jul 14, 2010 at 1:28 PM, Shashikant Kale
<Shashikant.Kale@xxxxxxxxxxxxxxxx> wrote:
> We have been using spring managed em (eclipselink as provider) alongwith spring transactions. AFAIK an em is created with a spring transaction and is closed when transaction is committed/rolled back. Thus the entity 'managed to unmanaged' lifecycle is bound to the transaction boundary.
>
> HTH,
> Shashi
>
> -----Original Message-----
> From: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Tim Hollosy
> Sent: Wednesday, July 14, 2010 10:47 PM
> To: EclipseLink User Discussions
> Subject: [eclipselink-users] Safe to story entity in a web session obtained from @PersistenceContext ?
>
> This is more of a spring question, but I'm curious. We inject our
> EntityManager to our DAO using the @PersistenceContext annotation.
> Would it be safe to throw an entity in the session without explicit
> cleanup of the entity or would that entity stay managed? I'm concerned
> that over time I'd run into memory issues. I can't find a programmatic
> way to detach an entity short of calling close on the EntityManager
> but I don't want to do that, since in spring it's shared.
>
> I plan on running some experiments to see how long that entity stays
> managed, but I thought I'd ask here to see if anyone's dealt with this
> in the past.
>
> ./tch
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>


Back to the top