Hi,
I have implemented a distributed key with triggers.
That is a key that guards uniqueness over many columns in many tables.
It can also generate a unique key for insert statements when they don't
provide an explicit id.
To be compatible with jdbc PreparedStatement's getGeneratedKeys() I
tried to set the generated
id into session:
JdbcConnection jconn = (JdbcConnection);
Session session = (Session) jconn.getSession();
session.setLastIdentity(ValueLong.get(generatedId));
But I realized that this is being explicitly prevented by TriggerObject
that goes to extra length to ensure that trigger can not set that value.
In it's finalize block it set's the old scope identity after trigger.
} finally {
session.setScopeIdentity(identity);
...
}
Is there a reason for this?
I am wondering because I think my need seems reasonable.
- Rami
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.