Re: Locking in an eoObject.awakeFromInsertion(editingContext)?
Re: Locking in an eoObject.awakeFromInsertion(editingContext)?
- Subject: Re: Locking in an eoObject.awakeFromInsertion(editingContext)?
- From: Chuck Hill <email@hidden>
- Date: Tue, 28 Oct 2003 19:44:25 -0800
You should ensure that the EC is locked long before that method gets
called. It should certainly be locked before ec.insertObject(eo) is called.
Chuck
At 07:50 PM 28/10/2003 -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.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
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.