Re: Optimistic locking failure due to string trimming?
Re: Optimistic locking failure due to string trimming?
- Subject: Re: Optimistic locking failure due to string trimming?
- From: Chuck Hill <email@hidden>
- Date: Fri, 25 Jun 2010 07:39:04 -0700
On Jun 24, 2010, at 6:42 PM, Paul Hoadley wrote:
> On 25/06/2010, at 1:59 AM, Chuck Hill wrote:
>
>>> Is this expected? What does the 'RTRIM' in that data type mean—that is, _when_ is there trimming? I take it there's no trimming for an INSERT, or that trailing space wouldn't have made it out to the database. As a workaround, I was going to unselect 'note' as an attribute used for locking.
>>
>> Sounds like a sketchy implementation, but if the database trims on insert/update, EOF would only need to do this for the WHERE clause. Which is what you are seeing. As the database is obviously NOT doing this trim, I will gently suggest that the prototype has the incorrect data type.
>
> I noticed that in the database connection tab in Entity Modeler, I actually didn't have a prototype entity selected at all. Selecting EOJDBCPostgresqlPrototypes changes the data type for 'longText' to 'String (RTRIM)', but that's just incidental, isn't it? The correct entity is used at runtime based on the plugin I'm using, isn't it? (Wonder, WO 5.4.3)
>
> In any case, this is still reproducible when I select EOJDBCPostgresqlPrototypes in Entity Modeler. If I save a string with a trailing space into a longText attribute, I get an optimistic locking failure on trying to update.
That prototype is wrong. It should be String not String (RTRIM). Probably nobody had trailing spaces before so nobody noticed it.
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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