openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume CHAUVET <>
Subject Strange EM.refresh behaviour ?
Date Mon, 22 Jul 2013 15:36:04 GMT
Hello OpenJPA users, 

We have a use case that seem not clearly described in the specification (JSR317 [3.2.5] Refreshing
an Entity Instance):
if X is a managed entity with a @onetomany relationship (with cascade=ALL, orphanRemoval=true)
who contains an unmanaged entity. We want to refresh X to retrieve original data, including
the original relationship. Does EM.refresh must remove unmanaged entities from relationship
collection because these data doesn't exists in the datastore instead of throwing an unmanaged
exception  ? In the same way, removing a specific entity from the relationship with the remove
method of the relationship collection (or calling the clear method to empty the relationship)
should be reloaded from datastore (or cache) when calling EM.refresh ?

I hope somebody enlighten me because we have many entities edited through several swing UI
that provide a < cancel > function...

Please find attached, a smallish unitary test that reproduces our use cases.

Guillaume CHAUVET

View raw message