JBoss allocated sequences wrong and were not sync
When i used JBoss 5.1.0 and PostgreSql database and tried to insert / persist a row in database.
Persisted row contained id which was allocated 50 or 250 bigger that sequence which is created for that table and entity.
Suddenly i noticed that entity and sequence were not sync.
Annotation parameter allocationSize and tmp folder remove helped.
@SequenceGenerator(name = “gen_name”, sequenceName = “seq_name”, allocationSize = 1)
Remove:
jboss_5.1.0.GA\server\default\tmp
jboss_5.1.0.GA\server\default\work
Advertisement