Hi,
Currently we are using ‘sequence’ as the id generator but where we have a lot of inserts (which are done as part of a wider saveOrUpdate on a parent object) hibernate is selecting from the sequence and then running the insert, understandably so that it can set the id onto the object, but this appears to be causing quite a slowdown where we have a LOT of inserts. This runs a lot faster with seqhilo because of fewer trips to the DB but just wanted to ensure there is no risk of id collision between different session factories using the same strategy. Specifically with an underlying Oracle sequence and with multiple hibernate session factories on multiple app servers on multiple machines.
Also - if we change to use seqhilo it will be on top of a set of existing data and an already used (albeit absolutely sequentially and not as a seed) sequence. Could this cause any id collision issues?
Alternatively - is there a way to force hibernate to use inline .nextval or something similar in the insert and not to bother trying to populate the ID back onto the object? Since we don't need it and just want the insert to be fast.
Thanks, Martin
|