openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilberto C Andrade <>
Subject Re: NPE on ManyToOne while using insertable = false, updatable = false
Date Thu, 03 Jan 2008 19:37:58 GMT
> Hi Gilberto,
> I think you might have encountered an issue with caching.
> When you persist the Item entity, the reference to Produto is null (I
> didn't see anywhere that you set it). So when you retrieve it, openjpa
> doesn't go to the database but simply returns what is in the (second
> level) cache. In the cache, the object that was stored is retrieved.
Can I disable that behavior(second level cache) on some operations?

> JPA spec (at the JPA 1.0 level) that the application manage both sides
> of relationships. In the code below, can you add a statement that sets
> the Produto field in Item before commit?
Yes! Now it works.


View raw message