openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re:
Date Wed, 13 Dec 2006 02:33:57 GMT
Hi Dain,

On Dec 12, 2006, at 6:24 PM, Dain Sundstrom wrote:

> Does JPA guarantee that only one bean will be activated for a  
> specific pk per transaction?

Yes.

> Specifically, will OpenJPA ever create more that one bean for a  
> specific Class:PK in a single transaction?

No.
>
> The reason I'm asking is I may want to use an identity map and  
> don't want to end up with multiple entries for the same pk.

That is actually the internal implementation.

> This would be very convenient for managing beans that have not had  
> identity established yet.

Huh? JPA implementations only create beans that have a database  
identity already. For "new" beans, you need to call em.persist in  
order to create a database identity, and this will fail (eventually,  
according to both CMP2 and EJB3 specifications) if there is already a  
persistent bean with the same identity.

Craig
>
> -dain

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message