openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fengyi <liufengyi2006...@sina.com>
Subject Re: [openjpa-2.2.1] when i cascade merge entity. a exception thrown
Date Wed, 03 Jul 2013 08:15:31 GMT
but at the same time , i find a strange thing,it's not reasonable.

when i query a object which have an date Field. after query,the entity
manager closed.
then i want set a new date
,ie:card.getModified().setTime(Calendar.getInstance().getTimeInMillis())
there is a exception:
<openjpa-2.2.1-runknown fatal user error>
org.apache.openjpa.persistence.InvalidStateException: The context has been
closed.  The stack trace at which the context was closed is held in the
embedded exception.

if i set a new Date ,ie:
there is another
exception:card.setModified(Calendar.getInstance().getTime());
<openjpa-2.2.1-runknown nonfatal store error>
org.apache.openjpa.util.StoreException: java.util.Date cannot be cast to
org.apache.openjpa.enhance.PersistenceCapable

if i didn't modify the date:
the exception is :
<openjpa-2.2.1-runknown nonfatal store error>
org.apache.openjpa.util.StoreException:
org.apache.openjpa.util.java$util$Date$proxy cannot be cast to
org.apache.openjpa.enhance.PersistenceCapable


only i set null can update success. now i lose my self!
any tip?
or anyone knows which situation will encounter  this error and explain this
thing. 
i can avoid this situation use cascade merge as i mentioned above!



--
View this message in context: http://openjpa.208410.n2.nabble.com/openjpa-2-2-1-when-i-cascade-merge-entity-a-exception-thrown-tp7584325p7584328.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message