Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[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


Back to the top