Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
- Subject: Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
- From: Ken Anderson <email@hidden>
- Date: Tue, 01 Nov 2005 13:00:07 -0500
On Nov 1, 2005, at 12:40 PM, Luis Miguel Espinoza wrote:
Good day everybody,
I am new into WebObjects environment, and I want begin to the right
way into webobjects programming.
I have some questions, and hope you answer me in base your
experience a solutions.
1. Is better use Timestamp field as lock?? or May I use all fields
as lock into EOModel??
The fields you use for locking are completely based on your needs.
Personally, I like to have a transactionID (an int) on each record
that gets updated every time the record changes. Therefore, I can
lock on that and nothing else. If you can allow the possibility of
users stepping on someone else's change, you can lock only the
important ones. What EOF basically does is take all the fields that
have the lock next to them and verify that that record still exists
in the database with those values prior to saving.
2. Is good practice use one field as PrimaryKey (as webobjects
tutorial say) or must I use composed PrimaryKeys when I have to use
them??
The best practice is to have a single integer primary key that is not
used by the user. If you are starting a new project, this is
certainly the way to go, since all your foreign keys can be simple
integers. I would never have a primary key other than a unique
integer that users never see. If you have to use an existing
database, do what you have to!
Thanks , and sorry if my question are begginer question??
Luis M.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com
This email sent to email@hidden
_______________________________________________
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