-->
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: trigger ID generator vs Hibernate generator
PostPosted: Tue Nov 04, 2003 10:40 am 
Newbie

Joined: Tue Oct 28, 2003 3:48 am
Posts: 8
Location: LECOTAD
Hi all!

Is anyone using Hibernate to connect to Sybase? We still encourage some strange behaviour.

Our main problem is special customer data model. Instead of using IDENTITY column types for generating of IDs, there exist triggers which retrieves the values and populates required columns. However we whatever we tried, we still received an error.

If we define ASSIGNED generator, the hibernate does not retrieve correct ID value from the database after insert. We tried to flush or refresh but without success. Probably we could use find but this could cost a lot.

If we define IDENTITY generator, we can see the error:
net.sf.hibernate.JDBCException: could not insert: [hb.test.Person]: The column person_PK in table person does not allow null values.
It seems like hibernate creates statement to insert also ID column as NULL what is not acceptable to DB.

We also tried NATIVE generator but the errors remain.

Has anyone any ideas/experience with such a functionality? I think on Oracle this would mean the same if a man uses sequence generator.


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.