Re: an interesting lockRowComparingAttributes:
Re: an interesting lockRowComparingAttributes:
- Subject: Re: an interesting lockRowComparingAttributes:
- From: Chuck Hill <email@hidden>
- Date: Tue, 1 Apr 2008 15:19:22 -0700
On Apr 1, 2008, at 3:06 PM, Johan Henselmans wrote:
I have an interesting time with the following error:
Error:
com.webobjects.eoaccess.EOGeneralAdaptorException:
lockRowComparingAttributes --
com.webobjects.jdbcadaptor.JDBCChannel: lock operation failed to
select any rows
The situation:
I am using ERProtoypes and a Postgresql database (latest jdbc-
plugin, latest version of postgresql, latest version of
postgresql.jar, webobjects5.3.3 on Leopard).
Suddenly, after adding some attributes to a table the database (and
migrating from mysql to postgresql), I got the following error,
while using directToWeb to update some info in the database. The
EOModel is in a separate framework.
I suspected it had something to do with locking, as the error said
that the lock operation failed (don't you think this sentence could
come directly from a police investigation?)
:-)
To find out what the problem was, I unlocked all the suspected
fields, and then added them one by one.
So far so good. There were two fields that caused the problem, both
text fields in Postgresql SQL lingo, which I thought would be
longText in ERPrototypes. Other text fields did not give the
problem. I then removed the text that was in it, (still unlocked)
and added text from a field via copy and paste in a D2W app into the
field, so that it contains exactly the same info as the other fields.
Now I lock the field again, and once again, the error pops up.
I tried removing the prototype going from longText (String (RTRIM) -
String c) to just String -String S, no avail.
I know it's still fool's day, but why me?
I think problems like this just like you. ;-)
Is there a debug option to turn on to get all the SQL information
and anything related out of the framework, or something I should
look at?
EOF _should_ be using optimistic locking. So it _should_ not be
locking anything. That it is trying to lock indicates that something
bad is happening. I suspect that the source of your troubles may be
"and migrating from mysql to postgresql". Is there any old jdbc2info
from MySQL in your models? Entity Modeler (modern version) should
remove this. I am not sure about Wonder. Using jdbc2info from one
database on a different database can definitely cause this error.
Other than that, I'd take a long look at the prototypes for this
columns (and while you are at it, make sure it is loading the ones for
Postgres and not MySQL).
Maybe Mike remembers some more causes of this?
Chuck
Some of the EOMOdel info:
{
allowsNull = Y;
columnName = "confirmation_text";
name = confirmationText;
prototypeName = longText;
},
{
allowsNull = Y;
columnName = "duration_text";
name = durationText;
prototypeName = longText;
},
confirmationText lock creates error, durationText is fine.
In the lock section:
attributesUsedForLocking = (
amount,
amountOneExtra,
bankDetails,
conditionURL,
conditions,
confirmationText,
durationText,
[etc]
);
postgresql:
nidfhaarlem=# \d training;
Table "public.training"
Column | Type
| Modifiers
-------------------------+------------------------
+----------------------------------------------------
amount | numeric(18,2) |
amount_one_extra | numeric(18,2) |
bank_details | text |
condition_url | character varying(255) |
conditions | text |
confirmation_text | text |
duration_text | text |
[etc]
Indexes:
"training_pk" PRIMARY KEY, btree (show_id)
Regards,
Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6279159
_______________________________________________
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
--
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
_______________________________________________
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