Tuesday, 22 February 2011 10:18

Make sure you do not lock unnecessary attributes in an entity in a WebObjects EO model

Written by  Kamal Shah
Rate this item
(0 votes)
One more mistake many people doing EOModelling with WebObjects make - unnecessarily locking attributes.

In the EOModeller tool, all new attributes come with the locking option set to 'on'. I have no idea why. This really should have a default of 'off'. The locking attribute is used when an update is being made to the database. During the actual update, the attributes that are set as 'locked' are used in the 'where' clause of the update query being sent to the database.

Typically, you would only need the primary key when you are updating a single row. Now, if you have set another attribute to be locked and you are trying to update that same attribute, you will get a 'GeneralAdaptorException'. That's because, you set the attribute to be locked and you are trying to update it!

The problem is the tool sets everything to be locked by default. What I have started doing is to set everything to unlocked except the primary and foreign keys which you never ever update in WebObjects. That has worked well for me.

Does anyone have any more insight into this?

... http://www.kamaldshah.com/2011/02/make-sure-you-do-not-lock-unnecessary.html

Kamal Shah

Kamal Shah

Hello, I'm Kamal from Hyderabad, India. I have been on dialysis for the last 13 years, six of them on PD, the rest on hemo. I have been on daily nocturnal home hemodialysis for the last four and half years. I can do pretty much everything myself. I love to travel and do short weekend trips or longer trips to places which have dialysis centers. Goa in India is a personal favorite. It is a great holiday destination and has two very good dialysis centers.

E-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Leave a comment

Make sure you enter the (*) required information where indicated.
Basic HTML code is allowed.

Share |
Copyright © 2017 Global Dialysis. All Rights Reserved.

Notice: Undefined variable: query in /home/globaldi/public_html/components/com_joomlawatch/class.joomlawatch.db.php on line 129