Re: Optimistic locking failure on insert
Re: Optimistic locking failure on insert
- Subject: Re: Optimistic locking failure on insert
- From: Ian Joyner <email@hidden>
- Date: Thu, 16 Mar 2006 12:48:00 +1100
A really big thanks to Jerry and Chuck for expending a lot of effort
on looking through this and debabating it. I'm trying to respond in
as few short posts as possible, because I've probably already bored
people to tears.
On 16/03/2006, at 2:31 AM, Jerry W. Walker wrote:
Hi, Ian,
I can't imagine (short of a bug in the development environment) how
the code you're exposing below could cause an optimistic locking
failure. The upshot of the code below only reads from the store. It
neither creates nor updates any records therein.
Optimistic locking failures occur on an attempt to write a record
to the database when the record on the database into which you're
trying to write has data other than what you expected to be there.
This is typically caused by someone else writing into the same
record before you, but can also be caused by rounding errors in
fields your checking for the optimistic locking check (e.g.
including Doubles or Date fields among the optimistic lock check
fields).
That's what gets me. I did have locking on on some date fields, but
even turned it off on all attributes to no avail (how do you turn of
optimistic locking altogether though, Inside EOM doesn't seem to
explain that).
In looking over the debugging statements below, it looks like there
is an attempt to save a member record which contains itself as a
member. That is, it looks like the inserted record has the
following recursive structure:
MemberRecord:
details = null
begin_date = 3/14/2006 @ 5:53:51 GMT
position = null
member = <self reference> ************ IS THIS CORRECT?
****************
Your analysis from the output is correct. But I'm not sure how that
got there because there is no attribute or relationship called member
in the model, or in added methods in the Java, so I think I was
assuming this was some kind of internal WO thing, but perhaps it is
strange?
(The closest thing is a reflexive relationship to the superclass
person for 'contact').
Thanks
Ian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden