Thank you Ken,
I actually had a bug where I was updating the wrong object than what
I thought I was supposed to be updating, but I didn't realize what
the lock attribute was for. I have removed it on a single column that
was a FLOAT since I could see that being a problem in the future with
possible different rounding precision.
Tarun
On Jul 15, 2007, at 6:08 PM, Ken Anderson wrote:
Tarun,
It would be my guess that you're having problems with optimistic
locking. I'm assuming you're using a single webobjects app and
that nothing else is updating the database. If that's true, what
type of columns do you have as locking attributes (the lock
symbol) ? With some databases, using dates or high resolution
numerics can cause update errors because the stored resolution is
not the same as the database resolution. So, you might get SQL
that looks like:
update table set x=1, y=2.333334, z='10-Jul-07 00:00.001' where
key=1 and y=2.33333 and z='11-Jul-07 00:00.000'
I like having a single 'trans_id' integer column to lock on that
always gets incremented. That way, a single value can determine
whether or not the record has been updated inbetween my read and my
save.
Ken
On Jul 15, 2007, at 6:39 PM, Tarun Reddy wrote:
I have code where I updated a value based upon user input. The
first time I update the value, it correctly updates, however if I
attempt to update it again through a second web form submit, I get
the following error:
Application: WOIdeas
Error: com.webobjects.eoaccess.EOGeneralAdaptorException:
updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row
in database
Reason: updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row
in database
Stack trace:
File Line# Method Package
Here is my basic code:
EOEditingContext ec = session.defaultEditingContext();
....
IdeaRating ir = findIdeaRating(session.getUser(), topIdea);
else {
//update ideaRating
int myRatingInt = new
Integer(myRating).intValue();
topIdea.updateRatingToAverage(ir.rating().intValue(),
myRatingInt);
ir.setRating(myRatingInt);
ec.saveChanges();
}
Any ideas?
Thanks!
Tarun
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kenlists%
40anderhome.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]