geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacek Laskowski" <>
Subject Re: EntityExistsException: Attempt to persist detached object
Date Tue, 27 Nov 2007 12:56:43 GMT
On Nov 27, 2007 1:43 PM, maho77 <> wrote:

> thanks, I did it like you advised and I worked. But not as expected. I
> received the following exception:
> <openjpa-1.0.0-r420667:568756 nonfatal store error>
> org.apache.openjpa.util.StoreException: Attempt to update the sequence table
> "ID_GENERATOR" failed.  The sequence table is typically created when you run
> the mappingtool's refresh action on any datastore identity class. If you
> have not run the mappingtool but want to create the sequence table, run:
> java org.apache.openjpa.jdbc.kernel.TableJDBCSeq -action add
> So according to this exception I changed the table to:
>         name0 VARCHAR(100) NOT NULL,
>         id_value INTEGER UNSIGNED NOT NULL,
>         PRIMARY KEY(name0)
> );
> And it worked without any changes in the annotation.
> Can you explain this? Thank you very much.

You can specify whether a schema for your entities should be generated
in persistence.xml of your application -
openjpa.jdbc.SynchronizeMappings. Try the following to fix it:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns=""
  <persistence-unit ...>
      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />

You may also want to run it with the more verbose property value:

  <property name="openjpa.jdbc.SynchronizeMappings"


Jacek Laskowski

View raw message