openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: Persist detached entities into a memory database
Date Thu, 16 May 2013 15:39:32 GMT
Sounds like you need different JPA Entity definitions.  If you used
timestamp generation when you first created/persisted them, but now you
want to persist these in a different datasource, then you'll need a
modified JPA Entity definition that no longer used timestamp id generation.

Kevin


On Thu, May 16, 2013 at 2:41 AM, Guillaume Chauvet <
guillaume.chauvet@qualiformed.com> wrote:

> Hello,
>
> If I use "persist" operation, OpenJPA throws :
> <openjpa-2.2.2-QFD-r422266:1446687M nonfatal store error>
> org.apache.openjpa.persistence.EntityExistsException: Attempt to persist
> detached object "xxxx.xxxxx.xxxx.InternalUser@26f50154".  If this is a new
> instance, make sure any version and/or auto-generated primary key fields
> are
> null/default when persisting.
> FailedObject: xxxx.xxxxx.xxxx.InternalUser@26f50154
>
> If I use "merge" operation, OpenJPA throws :
> <openjpa-2.2.2-QFD-r422266:1446687M fatal store error>
> org.apache.openjpa.persistence.OptimisticLockException: Attempted to attach
> deleted instance type "class xxxx.xxxxx.xxxx.InternalUser" with oid
> "1359392486037000524".  If the instance is new, the version field should be
> left to its default value.
> FailedObject: xxxx.xxxxx.xxxx.InternalUser@165f5a4
>
> Regards,
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Persist-detached-entities-into-a-memory-database-tp7583921p7583923.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

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