• 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: Chuck Hill <email@hidden>
  • Date: Tue, 1 Nov 2005 10:51:55 -0800


On Nov 1, 2005, at 10:30 AM, Luis Miguel Espinoza wrote:

1. Is faster for EO use one Column as lock or faster use all fields that I consider to need for lock,? Can it make slower or faster my application or if I use anyone my applicaction benchmark will be equal??

Compared to everything else that runs as part of your application, it won't make any difference what you lock on (well, other than large BLOB/CLOB fields). As long as the PK is used for locking (and you can NOT avoid this!), the cost will be for the database to make some field value comparisons on a single row. This will be very fast and not something I'd even bother to think about.

I use multiple columns as I then don't need to worry about setting a timestamp or incrementing a field and I can be selective in what causes an optimistic locking failure.

Chuck


2. What's about reports ?? What is better solution? I was tried JFreeReport in JSP application. I was reading some books (sams, wrox, etc). I know how export to excel o html, but what about Groups Reports with Sum, Total, etc..

Thanks all for your soon answer, because that is critical point, because I have my eomodel finished, and I don't want use Timestamp as my other older JSP aplications, and WebObjects present to me other best solutions.

Luis M.

NOTE: Sorry for my english.


On Nov 1, 2005, at 12:00 PM, Ken Anderson wrote:



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:
40wemisa.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:
40global-village.net


This email sent to email@hidden


--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro


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
  • Follow-Ups:
    • Re: What's is better solution for Lock? Use Timestamp or "mark all fields"
      • From: Arturo Perez <email@hidden>
References: 
 >What's is better solution for Lock? Use Timestamp or "mark all fields" (From: Luis Miguel Espinoza <email@hidden>)
 >Re: What's is better solution for Lock? Use Timestamp or "mark all fields" (From: Ken Anderson <email@hidden>)
 >Re: 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