4 Replies Latest reply on Feb 23, 2006 9:46 AM by Jan Philipp Giel

    Schemaupdate tries to create existing sequences ?

    Yves Carlier Newbie


      I use an entity bean looking like this

      @Table(name="t_gridcells", schema="grid")
      @SequenceGenerator(name="GridCellBeanSequence", sequenceName="grid.s_gridcells")
      public class GridCellBean {
       private Integer id;
       @Id(generate=GeneratorType.SEQUENCE, generator="GridCellBeanSequence")
       public Integer getId() {
       return id;
       public void setId(Integer id) {
       this.id = id;

      This works. The sequence s_gridcells in my grid schema is used to generate the id for new beans.
      The only problem is that when I deploy my ear-file the JBoss server gives the following error-output:

      09:31:23,093 INFO [DatabaseMetadata] table not found: grid.s_gridcells

      09:31:23,203 ERROR [SchemaUpdate] Unsuccessful: create sequence grid.s_gridcells
      09:31:23,203 ERROR [SchemaUpdate] ERROR: relation "s_gridcells" already exists

      Does anyone have a clue how to fix this?

      I know that if I change the sequenceName="grid.s_gridcells" to sequenceName="s_gridcells" the sequence isn't used/found. So, because there is no "schema" attribute in the SequenceGenerator-annotation I put the "grid." in front of the name.

      Any help is extremely welcome....