openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Praveen G" <praveenkumar.gan...@emagia.com>
Subject Problem with Entity Cache
Date Tue, 22 May 2007 14:57:21 GMT
Hello Patrick Linskey,

We are facing the following problem in our project. 

<0.9.7-incubating fatal user error> org.apache.openjpa.persistence.InvalidStateException:
Encountered unmanaged object "com.vormetric.server.dao.user.RoleDTO@51ac51ac" in persistent
field "com.vormetric.server.dao.user.UserDTO.roles<element:class com.vormetric.server.dao.user.RoleDTO>"
of managed object "com.vormetric.server.dao.user.UserDTO@4f164f16" during flush.  However,
this field does not allow cascade persist.  You cannot flush unmanaged objects.
FailedObject: com.vormetric.server.dao.user.RoleDTO@51ac51ac
 at org.apache.openjpa.kernel.SingleFieldManager.preFlushPC(SingleFieldManager.java:750)
 at org.apache.openjpa.kernel.SingleFieldManager.preFlushPCs(SingleFieldManager.java:732)
 at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:634)
 at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:559)
 at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:475)
 at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2678)
 at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
 at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:854)
 at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1903)
 at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1863)
 at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1634)
 at org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:478)
 at org.apache.openjpa.kernel.StateManagerImpl.assignField(StateManagerImpl.java:558)
 at org.apache.openjpa.kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1365)
 at org.apache.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java:1348)
 at com.vormetric.server.dao.user.UserDTO.pcGetid(UserDTO.java)
 at com.vormetric.server.dao.user.UserDTO.getId(UserDTO.java:93)
 at com.vormetric.server.dao.user.hibernate.UserDAOImpl.create(UserDAOImpl.java:89)
 at com.vormetric.server.sdk.user.UserManager.addUser(UserManager.java:52)
 at com.vormetric.server.mgmt.console.user.UserAddAction.execute(UserAddAction.java:67)


We are having 2 entity classes UserDTO and RoleDTO files. We want the RoleDTO entity to be
readonly.
So Please help us to make an entity readonly in an application.

The following is the tag in our existing hibernate mapping file. We are replacing the hibernate
code with OpenJPA code

<hibernate-mapping>
    <class name="com.vormetric.server.dao.user.RoleDTO" table="CGSS_ROLE">
  <cache usage="read-only"/>

So please help us as soon as possible, to make an entity readonly.

Thanks,
Praveen Kumar.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message