title: Suddenly JPA ignores the Oracle sequence value
body: <p>After a few weeks, my application now has a strange behaviour. When I try to do an insert, the sequence value is always <strong>zero</strong>, but the database gives me the correct value. The sequence is as follows:</p>
  
  <pre><code>CREATE SEQUENCE SEQ_ID_PERSONA_AUTOMATICKEY
  INCREMENT BY 1
  START WITH 1
  MAXVALUE 999
  MINVALUE 1
  NOCYCLE;
  </code></pre>
  
  <p>The entity has the necessary annotations and as I said it worked perfect.</p>
  
  <pre><code>@Id
  @SequenceGenerator(name = "MY_SEQUENCE", sequenceName = "SEQ_ID_PERSONA_AUTOMATICKEY", allocationSize = 1)
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "MY_SEQUENCE")
  @Column(name = "ID_PERSONA")
  private Long idPersona;
  </code></pre>
  
  <p>The insert method has nothing special, just <code>em.persist(persona);</code></p>
  
  <p>I don't know what to do. I tried to recompile the project and redeploy it but it always gives me <strong>zero</strong>. Any suggestions? Thanks.</p>
  
  <p>Using Oracle Database 11g Express, Oracle Weblogic 12c, Java EE 6</p>