|EclipseLink Constraint Violation Issue [message #1713533]
||Wed, 04 November 2015 20:54
| Santosh Kantharaj
Registered: November 2015
So I have an Eclipselink question. I have a two column table, with football team names and their ranking. When I go to update this table, sometimes the ranking of these teams change some teams end up swapping ranks with one another (last week, OSU was #1 and Clemson was #3, and this week Clemson is #1 and OSU is #3).
I've got a uniqueness constraint on the ranking column that means that no two teams have the same ranking on my table. So, in the aforementioned example, if I were to change those rankings, there would be a transition state that would violate that constraint (I update OSU's ranking to #3 before updating Clemson's to #1 there is a moment where both are ranked #3).
This transition state violates the uniqueness constraint, as expected.
Now, instead of having this constraint apply at all times, I've changed it to a "deferred" constraint where the constraint only applies when "commit" is explicitly executed. So, even though I have this uniqueness constraint, I can have that violating transition state without SQL Developer complaining, and the only time that the uniqueness check is run is after a commit.
I've tested this, and it works. Now, I want to run this same logic through Eclipselink, using my deferred constraint. But it seems that Eclipselink inserts a bunch of commits into the server-generated SQL, thus overriding the benefit of my deferred constraint.
Is there a solution to this, where I can tell Eclipselink where and when to commit? Thank you.
Powered by FUDForum
. Page generated in 0.01357 seconds