Currently Hibernate generates 2 statements for each insert. The first statement selects the next value from the Oracle sequence. The second statement is the insert.
With the new JDBC3 feature of getting the returned keys it should be possible to reduce the insert to a single database roundtrip.
Can Hibernate generate a statement like
INSERT INTO table VALUES (sequence.NEXTVAL, ...)
and use the value generated by Oracle?
I tried already to set use_get_generated_keys to true, but this works only for the identity generator.
BTW, I could not find this issue in the forum.
Greetings,
Robert
----
Hibernate version: 2.6.2
Database: Oracle 9
|