Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Sequences set via-triggers and the @SequenceGenerator annotation

Here's the situation.

I have a database where the pk sequence for each table is set via an
insert trigger. All of these triggers are dumb, and don't check to
make sure the pk is not already set in the row before grabbing the
nextval and setting it.

I discovered this problem while running some tests of doing cascade
persists, and my sequence and hence PK of a parent table was being
incremented twice. Once by EclipseLink a second time via the insert
trigger.

Is there some sort of way I can tell EclipseLink to Post-Fetch the
sequence after the insert and figure out relationships that way or
would I be better off just biting the bullet and making all my
triggers more intelligent?

Thanks,
Tim


Back to the top