openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Bauer <techhu...@gmail.com>
Subject Re: relation "mySequence" already exists
Date Mon, 07 Jun 2010 18:33:51 GMT
Hi Christopher,

As you found, it looks like you are running into issue OPENJPA-1259.  This
problem appears to be PostgreSQL specific, since I wasn't able to reproduce
the problem on DB2 (the sequence got dropped with DB2).

Not the best solution in the world but, for now, you could specify to ignore
the error.  This allows creation of the remaining DB artifacts to continue
and permits the app to run.

<property name="openjpa.jdbc.SynchronizeMappings"

value="buildSchema(SchemaAction='drop,add',IgnoreErrors=true)"/>

Unless someone else tackles it first, I should have some time to look into
the issue later this week.

hth,
-Jeremy

On Thu, Jun 3, 2010 at 2:17 PM, Christopher Schmidt <fakod666@googlemail.com
> wrote:

> Hi all, using OpenJPA 2.0.0 with Postgresql 8.4 JDBC4
>
> I want to create the schema with the following property:
> <property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(SchemaAction='drop,add')"/>
>
> The entity is defined as follows:
>
> @Entity
> @Table(name = "obj_item")
> @Inheritance(strategy = InheritanceType.JOINED)
> @SequenceGenerator(name = "obj_item_id_seq", sequenceName =
> "obj_item_id_seq", allocationSize = 1)
> class ObjectItem ...
>
> it seems that the sequence will not be dropped - so I get the
> following exception:
> org.apache.openjpa.persistence.PersistenceException: ERROR: relation
> "obj_item_id_seq" already exists {stmnt 1834517285 CREATE SEQUENCE
> obj_item_id_seq START WITH 1} [code=0, state=42P07]
>        at
> org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:556)...
>
> I found a bug here: https://issues.apache.org/jira/browse/OPENJPA-1259
>
> Any advice?
>
> Regards Christopher
>

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