I am using hibernate with jboss 4.2.3, and everything works, now I moved the code to Jboss 7.1.1, and suddenly I started to get:
Caused by: org.hibernate.exception.ConstraintViolationException: ORA-00001: unique constraint (OBLICORE.PK_ACE_WORKERS_QUEUE_STATS_ID) violated
Also the generated identifier is negative.
An entity that fails is defined as such:
@Id @SequenceGenerator(name = "SEQ_ACE_WORKERS_QUEUE_STATS_ID", sequenceName = "SEQ_ACE_WORKERS_QUEUE_STATS_ID", allocationSize = 500) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_ACE_WORKERS_QUEUE_STATS_ID") @Column(name = "ID") private long Id;
I checked the sequence in Oracle and seems to be OK (As I said, it worked before with jboss 4.2 and nothing has changed on the DB side since the migration).
I tried to write Hibernate request logs, but could not find this request, and I also registered a specific call that continues this class, and saw that it was called only once.
Tomer source share