• 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: Locking in an eoObject.awakeFromInsertion(editingContext)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Locking in an eoObject.awakeFromInsertion(editingContext)?


  • Subject: Re: Locking in an eoObject.awakeFromInsertion(editingContext)?
  • From: email@hidden
  • Date: Wed, 29 Oct 2003 11:07:38 CDT
  • Priority: 3 (Normal)

[demime could not interpret encoding binary - treating as plain text]
No, you do not need to call lock in awakeFromInsertion.

You SHOULD call the superclass implementation:
super.awakeFromInsertion(eoec); This is important, don't forget that line.

But the EC should already be locked by the calling context before
awakeFromInsertion is called, you don't need to lock it in awakeFromInsertion.

--Jonathan

On Tue, 28 Oct 2003 19:50:44 -0600 Ricardo Strausz wrote:

> Hola!
> just a simple question (I am not familiar with locking editing
> contexts):
> while (re)implementing the awakeFromInsertion method of an EO (son of
> EOGenericRecord), do I have to lock the editing context which is pased
> as an argument?
> (I am mixing NSDocument architecture and Cocoa/EOF, so I suppose that,
> while each NIB has its own editingContext, there may be more than one
> in the application)
>
> That is, is the following code correct?
>
>      public void awakeFromInsertion(EOEditingContext eoec) {
>          setFecha(new NSTimestamp());
>          setEstado(new Integer(1));
>          setIva(new Integer(15));
>      }
>
> Or is better?
>
>      public void awakeFromInsertion(EOEditingContext eoec) {
>          eoec.lock();
>          setFecha(new NSTimestamp());
>          setEstado(new Integer(1));
>          setIva(new Integer(15));
>          eoec.unlock();
>      }
>
>
> Dino
> http://homepage.mac.com/strausz
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Done: Locking in an eoObject.awakeFromInsertion(editingContext)?
      • From: Ricardo Strausz <email@hidden>
  • Prev by Date: Re: Is building from the command line supported? [xcodebuild is broken]
  • Next by Date: WO5.2.2: WOBuilder: Notice: the old non-smooth scrolling browser
  • Previous by thread: RE: Locking in an eoObject.awakeFromInsertion(editingContext)?
  • Next by thread: Done: Locking in an eoObject.awakeFromInsertion(editingContext)?
  • Index(es):
    • Date
    • Thread