Reputation: 3890
I am using Nhibernate for oracle, and I need to increment my primary key value for each insert. Which one is the best way and efficient way? Oracle sequence, Nhinerbate increment or another way?
Upvotes: 2
Views: 2572
Reputation: 64628
With oracle, you could use seqhilo
, which uses a database sequence instead of a separate table. You get the advantage of hilo (key generation in memory, no db roundtrip needed) and sequences (no separate transaction needed) at the same time.
Upvotes: 2