-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Duplicate ID using TableGenerator in Oracle, MS SQL and H2
PostPosted: Sat Jan 04, 2014 9:02 am 
Newbie

Joined: Sat Jan 04, 2014 8:52 am
Posts: 1
Hello,

I am experiencing a weird behavior where part of a long transaction I get duplicate ids.

I am using Jboss 7.2.0 and Hibernate 4.0.1.Final.

I have tried/experimented many solutions in vain: flush() after persist() and surrounding the insert with an embedded transaction (new).

I am also using the Hxtt driver for MS access where the problem is not reproduced.

Regards.

@TableGenerator(
table = "SEQUENCE_TABLE", name = "seq1", pkColumnName = "seq_name",
valueColumnName = "seq_val", pkColumnValue = "seq1", allocationSize = 1,
initialValue = 1001)
@Id
@GeneratedValue(
strategy = GenerationType.TABLE, generator = "seq1")
public Long getId() {
return super.getId();
}

_________________
---
Tarik Guelzim
Software Architect
http://tarikguelzim.wordpress.com
http://www.linkedin.com/in/tarikguelzim
https://twitter.com/#!/tarikguelzim


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.