-->
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.  [ 7 posts ] 
Author Message
 Post subject: sequence value problem
PostPosted: Wed Jul 18, 2007 3:47 pm 
Newbie

Joined: Sat Oct 07, 2006 2:48 pm
Posts: 17
Hi, i am using hibernate 3.2.1

I have an entity wich gets its ID from specific sequence:

@SequenceGenerator(name = "My_SEQ", sequenceName = "seq_sam")

@Entity
public class MyClass
{
int id;
String name;

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "My_SEQ")
public int getId()
{
}

public void setId(int id)
{
this.id = id;
}

...
}

when i persist a new entity, i can see the nextval call to this sequence, but the id value is not the nextvalue of the sequence. For example if the lastvalue of the sequence is 60600,the id value for my entity is 3234556, the difference between both values is enormous..

I am using jboss 4.2.0.GA, in jboss 4.0.3SP1 this works fine.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 18, 2007 8:39 pm 
Newbie

Joined: Sat Oct 07, 2006 2:48 pm
Posts: 17
it fails for all my entities that have its own sequence...

is there any new hibernate configuration i am missing?

moreover... none of my sequences have that value (about 3 millions), so i dont know where hibernate is getting that value.. i am very confused


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 19, 2007 7:56 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

visit
http://jira.jboss.com/jira/browse/EJBTHREE-139

Amila
(Don't forget to rate if helps)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 19, 2007 10:55 am 
Newbie

Joined: Sat Oct 07, 2006 2:48 pm
Posts: 17
Thanks for your reply

I had seen that jira, but that is not my problem. I can deploy very well and as i said above, when i persist a new entity with its own sequence, i can see the call to nextval fuction on that sequence, but the value assigned to my entity is not the returned one from nextval.

All the entities that have their own sequence fails... but those wich use default hibernate sequence work perfectly.

I am using jboss 4.2.0.GA, myabe this is causing the problem i dont know, it appears that i am the one who has this problem because i can not be able to find anything about this.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 19, 2007 1:16 pm 
Newbie

Joined: Sat Oct 07, 2006 2:48 pm
Posts: 17
i've checked some entities and i found some interesting information:

i divided the new id value generated by hibernate against the correct value generated by sequences and i found that all have as a result the number 50:

Entity A
last correct id: 229845
first bad id: 11492300

result: 50.000217537905980117035393417303

Entity B
last correct id: 65350
first bad id: 3267600
result: 50.001530221882172915072685539403

Entity C
last correct id: 7729
first bad id: 386800
result: 50.0452839953422176219433303144

i am wondering why 50 is the result for each change. As i said, none of the new bad values are on my sequences of default hibernates sequence.

i really dont know what happens whit this.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 19, 2007 3:03 pm 
Newbie

Joined: Sat Oct 07, 2006 2:48 pm
Posts: 17
I also tried with the lastest hibernate version. so i think it is jboss configuration problem...

hibernate-3.2.4.sp1
hibernate-annotations-3.3.0.GA
hibernate-entitymanager-3.3.1.GA


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 20, 2007 11:40 am 
Newbie

Joined: Sat Oct 07, 2006 2:48 pm
Posts: 17
Problem fixed...

allocationSize now has default to 50, it should be 1.


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

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.