Solved Problems – SQL, Java, JBoss



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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.