title: Play - oracle 10g : PersistenceException: ERROR executing DML bindLog[] error[ORA-00001: Unique key constraint violation (PLAY.PK_COMPANY)\n
body: <p>I'm trying to use oracle 10g and ebeans for the "computer database" sample application of plesk. But when I try to insert a new computer on the database, I get this error :</p>
  
  <pre><code>[PersistenceException: ERROR executing DML bindLog[] error[ORA-00001: Unique key constraint violation (PLAY.PK_COMPANY)\n ]]
  </code></pre>
  
  <p>at the following line :</p>
  
  <pre><code>{ 
   Form&lt;Computer&gt; computerForm = form(Computer.class).bindFromRequest();
          if(computerForm.hasErrors()) {
              return badRequest(createForm.render(computerForm));
          }
         computerForm.get().save(); //HERE
          flash("success", "Computer " + computerForm.get().name + " has been created");
         return GO_HOME;
  }
  </code></pre>
  
  <p>Here you have my object declaration :</p>
  
  <pre><code>@Entity 
  @Table(name="COMPUTER")
  @SequenceGenerator(name = "computer_seq", sequenceName = "computer_seq")
  public class Computer extends Model {
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      public Long id;
  
      @Constraints.Required
      @Column(name="name")
      public String name;
  
      @Column(name="introduced")
      public String introduced;
  
      @Column(name="discontinued")
      public String discontinued;
  
      @ManyToOne(cascade = CascadeType.MERGE)
      public Company company;
  
      /**
       * Generic query helper for entity Computer with id Long
       */
      public static Finder&lt;Long,Computer&gt; find = new Finder&lt;Long,Computer&gt;(Long.class, Computer.class); 
  
      /**
       * Return a page of computer
       *
       * @param page Page to display
       * @param pageSize Number of computers per page
       * @param sortBy Computer property used for sorting
       * @param order Sort order (either or asc or desc)
       * @param filter Filter applied on the name column
       */
      public static Page&lt;Computer&gt; page(int page, int pageSize, String sortBy, String order, String filter) {
          return 
              find.where()
                  .ilike("name", "%" + filter + "%")
                  .orderBy(sortBy + " " + order)
                  .fetch("company")
                  .findPagingList(pageSize)
                  .getPage(page);
      }
  
  }
  </code></pre>
  
  <p><strong>EDIT 1:</strong>
  I tried different <code>GeneratedValue strategy</code> like <code>AUTO</code> and <code>IDENTITY</code> but nothing work....</p>
  
  <p><strong>EDIT 2:</strong>
  I tried to use <code>Sequence</code> strategy but it's not working too : </p>
  
  <pre><code>@SequenceGenerator(name = "computer_seq", sequenceName = "computer_seq", initialValue=1, allocationSize=100)
  [...]
      @Id
      @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="computer_seq")
      public Long id;
  </code></pre>
  
  <p><strong>EDIT 3:</strong>
  Here you have the company entity :</p>
  
  <pre><code>@Entity 
  @Table(name="COMPANY")
  @SequenceGenerator(name = "company_seq", sequenceName = "company_seq", initialValue=1, allocationSize=100)
  public class Company extends Model {
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      public Long id;
  
      @Constraints.Required
      @Column(name="name")
      public String name;
  
      /**
       * Generic query helper for entity Company with id Long
       */
      public static Model.Finder&lt;Long,Company&gt; find = new Model.Finder&lt;Long,Company&gt;(Long.class, Company.class);
  
      public static Map&lt;String,String&gt; options() {
          LinkedHashMap&lt;String,String&gt; options = new LinkedHashMap&lt;String,String&gt;();
          for(Company c: Company.find.orderBy("name").findList()) {
              options.put(c.id.toString(), c.name);
          }
          return options;
      }
  
  }
  </code></pre>
  
  <p>I tried with a <code>SEQUENCE strategy</code> and <code>AUTO strategy</code> and it's not working too.</p>