Re: lock operation locked more than one row issue!
Re: lock operation locked more than one row issue!
- Subject: Re: lock operation locked more than one row issue!
- From: Chuck Hill <email@hidden>
- Date: Wed, 27 May 2009 12:21:55 -0700
On May 27, 2009, at 12:16 PM, Ryan Klems wrote:
I'm coming in to this thread a little late, and I don't have the
previous emails, but looking at the quoted parts from chuck's
email... I see that its doing pessimistic locking, and you aren't
expecting it to do that. One thing that I have run into in the past
is when you have something specified in the model, that isn't mapped
in the jdbc type info. For example, we had this exact scenario due
to the model specifying varchar, and the type info not having a
varchar, only a varchar2.
Yes! That is what I was circling around with "Are you using any data
types in this table that you don't use elsewhere?". Thanks for
reminding me of the exact cause.
Since it didn't know what the column was, it didn't know how to
optimistically lock it, so it fell back to pessimistic locking. I
actually added some code to WO (I think its in 5.5 and an unreleased
5.4), which will log a warning when this occurs, since it was such a
PITA to track down when it happened to me (specifically it will warn
from JDBCAdaptor.isValidQualifierType).
I'd be happy to have it as an out and out thrown exception as this
won't ever work, will it? Is there ever a useful / sane reason for it
to fall back to pessimistic locking in this case? Is this also what
handles CLOB/BLOB updates for something like FrontBase where they have
to be done in a separate statement?
You might try running in the debugger and breaking on
JDBCAdaptor.isValidQualifierType, see if its returning false (which
would force it to fall back to pessimistic locking), and examine
what the typeName is... you might find that its just ever so
slightly wrong.
Chuck
On May 27, 2009, at 11:54 AM, Chuck Hill wrote:
Hi Fred,
On May 27, 2009, at 11:29 AM, Fred Wells wrote:
OK, so after trying several different drivers and all throw some
type of locking error either lock failed to retrieve any rows or
lock operation locked more than one row.
It is not the driver. Really, it is not.
It is the SQL that EOF is generating. It is generating the WRONG
SQL. That is the problem that you need to solve. The error you
are seeing is just a symptom of the problem. You need to fix the
problem.
Right now I'm just looking for any more ideas as to where look for
a possible cause on this. The EOModel files seem to be fine
I'd be pretty suspicious that they are not. Are you using any data
types in this table that you don't use elsewhere? CLOBs? BLOBs?
I can't find anythign out of the ordinary I'm not sure where else
to look or if there are any parameters that can be changed to
alter how locking is handled.
It is either in the model definition or in your code. Or, I
suppose, both. You may be hitting a bug in EOF, but it is your
model or code that is exposing it.
Chuck
Frederick Wells
MarketForward, a Publicis Groupe Company
427 South LaSalle St.
Chicago, Il 60605
312.220.3056
-----Chuck Hill <email@hidden> wrote: -----
To: Guido Neitzer <email@hidden>
From: Chuck Hill <email@hidden>
Date: 05/26/2009 07:18PM
cc: Development WebObjects <email@hidden>, Fred
Wells <email@hidden>
Subject: Re: lock operation locked more than one row issue!
On May 26, 2009, at 5:13 PM, Guido Neitzer wrote:
> On May 26, 2009, at 1:37 PM, Chuck Hill wrote:
>
>> I am not sure what you have done then. The problem is not that
it
>> is selecting multiple rows. The problem is that it is trying to
>> lock rows:
>>
>>> > > SELECT ... FROM TemplateTask t0 WITH (UPDLOCK, ROWLOCK)"
>>
>>
>> EOF should not be doing that, that is optimistic^H^H^H^H^H^H^H^
>> pessimistic locking. Something has confused EOF which causes
it to
>> do this (it is a bug).
>
> Do you have to tell the plugin that explicitly? Never used MS SQL.
No, you don't. It is bad, but not that bad. ;-)
Chuck
--
Chuck Hill Senior Consultant / VP Development
Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/
------------------------------------------------------------------------
Disclaimer
The information in this email and any attachments may contain
proprietary and confidential information that is intended for the
addressee(s) only. If you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution,
retention or use of the contents of this information is
prohibited. When addressed to our clients or vendors, any
information contained in this e-mail or any attachments is subject
to the terms and conditions in any governing contract. If you have
received this e-mail in error, please immediately contact the
sender and delete the e-mail.
--
Chuck Hill Senior Consultant / VP Development
Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/
_______________________________________________
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
--
Chuck Hill Senior Consultant / VP Development
Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/
_______________________________________________
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