• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Arturo Perez <email@hidden>
  • Date: Tue, 01 Nov 2005 13:10:03 -0500

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??

Depending on your database Timestamp fields don't always compare equal. They often differ at the millisecond value. I would avoid them as locks for this reason. You can use all fields as lock but, again, avoid those with precision that's too high (like BigDecimal, etc). Generally speaking, it's best to pick a few fields that you know accurately signal when a row has been updated by someone else using SQL or by another WebObjects Instance.


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??

That's up to you. Compound primary keys are required by join tables. I've rarely needed compound primary keys, although I have often needed compound unique keys.


The best practice is to use primary keys that are meaningless to your users and to let WebObjects have total control over them. Alternate keys are your friend. WebObjects uses primary key as THE object identifier so note that once WO knows the primary key for something that it really, really, REALLY does not like you to change them.


Thanks , and sorry if my question are begginer question??

Luis M.

You're welcome. Keep the questions coming. _______________________________________________ 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
  • Follow-Ups:
    • Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
      • From: David Teran <email@hidden>
References: 
 >What's is better solution for Lock? Use Timestamp or "mark all fields" (From: Luis Miguel Espinoza <email@hidden>)

  • Prev by Date: Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
  • Next by Date: Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
  • Previous by thread: Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
  • Next by thread: Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
  • Index(es):
    • Date
    • Thread