> There are 3 options - use extended persistence
> context with a SFSB (but you'll also keep all other
> entities around)
Not an option in my case, I'm afraid.
> call em.find() to check if the
> entity is there in the database
I would like to avoid the extra query if possible. Maybe I can't.
> always call
> em.merge() - it's allowed to be called on a new
> entity
Right, but it creates a new entity and copies state over. In my case, there is some transient state in the entity to be persisted/merged that I want to hang on to.
Sounds like find() is what I want, or brute force try-to-persist, fall-back-to-merge.
Thanks for your help!
Best,
Laird
[Message sent by forum member 'ljnelson' (ljnelson)]
http://forums.java.net/jive/thread.jspa?messageID=280810