-->
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: How to avoid 2 calls to DB when inserting in Oracle?
PostPosted: Thu Nov 30, 2006 9:39 pm 
Beginner
Beginner

Joined: Tue Nov 28, 2006 4:26 pm
Posts: 32
Location: Montreal, Quebec, Canada
In order to maintain as much portability I use the "native" generator for my identifiers. Oracle uses sequences for ID generation. Normally, I would create a sequence and then a trigger before insert to fetch and assign this ID.

However, when native is the generator for Oracle, NHibernate makes its own call to the sequence to get the ID then a second call to do the actual insert of the record.

Is there a way to tell NHibernate not to use 2 calls and let Oracle do the assignment of the ID itself using the trigger option? I looked at the documentation and nothing was obvious to me.


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.