After a few weeks, my application now has a strange behaviour. When I try to do an insert, the sequence value is always zero, but the database gives me the correct value. The sequence is as follows:
CREATE SEQUENCE SEQ_ID_PERSONA_AUTOMATICKEY
INCREMENT BY 1
START WITH 1
MAXVALUE 999
MINVALUE 1
NOCYCLE;
The entity has the necessary annotations and as I said it worked perfect.
@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;
The insert method has nothing special, just em.persist(persona);
I don't know what to do. I tried to recompile the project and redeploy it but it always gives me zero. Any suggestions? Thanks.
Using Oracle Database 11g Express, Oracle Weblogic 12c, Java EE 6