-->
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: Interesting case: problem with Sequence and persisitng
PostPosted: Thu Jan 15, 2009 9:34 am 
Newbie

Joined: Thu Nov 22, 2007 11:43 am
Posts: 8
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:
Time zero: Hibernate: select MY_SEQ.nextval from dual

Time 1: Hibernate: select hibernate_sequence.nextval from dual

Hi all ,
i am having problem with hibernate / sequences .
I am currently using Hibernate via spring, usign session pe request pattern.
I have following workflow:

1) CreatorBean creates ObjectX and sends it to SenderBean
2) SenderBean sends ObjectX to an MQ, and received back a populated ObjectX.
3) SenderBean thent ries to persist ObjectX (which now has been populated with more data)

ObjectX ID is created usigna SEquence

at object creation, the sql call hibernate does is

Code:
select MY_SEQ.nextval from dual


At update time, the sql hibernae does is
Code:
select hibernate_sequence.nextval from dual



Now, why is that the second time hibernate is calling hibernate_sequence rather than MY_SEQ?

even considering fact taht i m using two different sessions, i m still puzzled on why it uses hibernate_sequence

I even tried to do a findById before i save it, and still got same problem

anyone cuold help?

thanks an dregars
marco


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.