Re: Unexpected awakeFromInsertion() behaviour

2008-01-17 Thread David Avendasora
Hey all, I just wanted to tie this email from Pierre Bernard into the whole awkeFromInsertion() thread, as this can have some quite unexpected and hard-to-trace impacts for Java Client projects (Mr. Peabody, please start the WABAC machine...): -Original Message- From: Pierre

Re: Unexpected awakeFromInsertion() behaviour

2008-01-17 Thread Robert Walker
Thus the correct wa to initialize an attribute in awakeFromInsertion is: if (attribute() == null) setAttribute(myDefaultValue); Wow, I guess I should have been following this thread closer. I had figured this out a long time ago, while working with JavaClient, so I

Re: Unexpected awakeFromInsertion() behaviour

2008-01-11 Thread Anjo Krank
Of what? Not applying default values when the object is not new? Oh, well... I do. Cheers, Anjo Am 11.01.2008 um 08:36 schrieb Mr. Pierre Frisch: I don't see the advantage Pierre -- Pierre Frisch [EMAIL PROTECTED] On Jan 10, 2008, at 22:00, Anjo Krank wrote: Am 11.01.2008 um 01:13

Re: Unexpected awakeFromInsertion() behaviour

2008-01-11 Thread Pierre Bernard
I believe this check in awakeFromInsertion is needed when working with nested contexts. I started adding the check when working with JavaClient. The EO would come from the client - which essentially is a nested context - with values filled in that you don't want to overwrite on the server

Re: Unexpected awakeFromInsertion() behaviour

2008-01-11 Thread Lachlan Deck
It might also be for java-inheritance logic. On 11/01/2008, at 10:22 PM, Pierre Bernard wrote: I believe this check in awakeFromInsertion is needed when working with nested contexts. I started adding the check when working with JavaClient. The EO would come from the client - which

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Chuck Hill
That looks like a bug, the EC should either not be calling awakeFromInsertion() or should be seeing the notifications from the change in value. It makes sense to me for it to call awakeFromInsertion() *BUT* this results in an object state different from what was there before the changes

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Mr. Pierre Frisch
Bug report please this needs to be fixed. Pierre -- Pierre Frisch [EMAIL PROTECTED] On Jan 10, 2008, at 11:04, Chuck Hill wrote: That looks like a bug, the EC should either not be calling awakeFromInsertion() or should be seeing the notifications from the change in value. It makes sense

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Chuck Hill
I will let Peter file the report. But while you are waiting... What do you think is the correct behavior here? Should it not call awakeFromInsertion again? Should it call it and undo any changes? Should it call it and detect that the object has been updated? Calling revert() should, I

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Mr. Pierre Frisch
I am not entirely sure of what the behavior should be but after the save the object is in the DB so this not a newly inserted object anymore. We do a deleteObject() and a revert() logically we should call awakeFromFetch() as this would have reverted the object to its fetched state (last

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Peter Vandoros
looks like it's been a while since i've read any wo tutorials :) Chuck Hill wrote: That looks like a bug, the EC should either not be calling awakeFromInsertion() or should be seeing the notifications from the change in value. It makes sense to me for it to call awakeFromInsertion() *BUT*

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Peter Vandoros
Hi Pierre, ID: 5682544 Thanks Peter Mr. Pierre Frisch wrote: Bug report please this needs to be fixed. Pierre -- Pierre Frisch [EMAIL PROTECTED] On Jan 10, 2008, at 11:04, Chuck Hill wrote: That looks like a bug, the EC should either not be calling

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Chuck Hill
That might be from some iServices code that I inherited. I'd always wondered why they did that. However, looking at the rest of the code, they might just have been confused. :-) Chuck On Jan 10, 2008, at 4:13 PM, Peter Vandoros wrote: looks like it's been a while since i've read any wo

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Peter Vandoros
LOL :-) Chuck Hill wrote: That might be from some iServices code that I inherited. I'd always wondered why they did that. However, looking at the rest of the code, they might just have been confused. :-) Chuck On Jan 10, 2008, at 4:13 PM, Peter Vandoros wrote: looks like

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Chuck Hill
On Jan 10, 2008, at 12:31 PM, Mr. Pierre Frisch wrote: I am not entirely sure of what the behavior should be but after the save the object is in the DB so this not a newly inserted object anymore. That is a good point. I'd guess if this is not a simple bug, that someone was looking as

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Mr. Pierre Frisch
-- Pierre Frisch [EMAIL PROTECTED] On Jan 10, 2008, at 18:37, Chuck Hill wrote: On Jan 10, 2008, at 12:31 PM, Mr. Pierre Frisch wrote: I am not entirely sure of what the behavior should be but after the save the object is in the DB so this not a newly inserted object anymore. That is

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Mr. Pierre Frisch
Hi Chuck, I am answering my own post. I think the correct behavior is to call awakeFromInsertion() if we have an object with EOTemporaryGlobalID and awakeFromFetch() if we have a regular EOGlobalID. Pierre -- Pierre Frisch [EMAIL PROTECTED] On Jan 10, 2008, at 19:33, Mr. Pierre Frisch

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Peter Vandoros
Mr. Pierre Frisch wrote: -- Pierre Frisch [EMAIL PROTECTED] On Jan 10, 2008, at 18:37, Chuck Hill wrote: On Jan 10, 2008, at 12:31 PM, Mr. Pierre Frisch wrote: I am not entirely sure of what the behavior should be but after the save the object is in the

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Chuck Hill
On Jan 10, 2008, at 8:04 PM, Mr. Pierre Frisch wrote: Hi Chuck, I am answering my own post. :-) I think the correct behavior is to call awakeFromInsertion() if we have an object with EOTemporaryGlobalID and awakeFromFetch() if we have a regular EOGlobalID. I am not sure if either

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Anjo Krank
Am 11.01.2008 um 01:13 schrieb Peter Vandoros: It makes sense to me for it to call awakeFromInsertion() *BUT* this results in an object state different from what was there before the changes being reverted. That seems to be a very wrong result. Which is why in (yawn) Wonder's

Re: Unexpected awakeFromInsertion() behaviour

2008-01-10 Thread Mr. Pierre Frisch
I don't see the advantage Pierre -- Pierre Frisch [EMAIL PROTECTED] On Jan 10, 2008, at 22:00, Anjo Krank wrote: Am 11.01.2008 um 01:13 schrieb Peter Vandoros: It makes sense to me for it to call awakeFromInsertion() *BUT* this results in an object state different from what was there

Re: Unexpected awakeFromInsertion() behaviour

2008-01-09 Thread Chuck Hill
Hi Peter, On Jan 8, 2008, at 9:23 PM, Peter Vandoros wrote: Hi List, I came across an interesting behaviour today with awakeFromInsertion () that i did not expect and I hope someone could shed some light. What happens is that awakeFromInsertion() is not only called when the EO is created

Re: Unexpected awakeFromInsertion() behaviour

2008-01-09 Thread Peter Vandoros
Hi Chuck, Chuck Hill wrote: Hi Peter, On Jan 8, 2008, at 9:23 PM, Peter Vandoros wrote: Hi List, I came across an interesting behaviour today with awakeFromInsertion() that i did not expect and I hope someone could shed some light. What happens is that

Re: Unexpected awakeFromInsertion() behaviour

2008-01-09 Thread Chuck Hill
Hi Peter, On Jan 9, 2008, at 2:49 PM, Peter Vandoros wrote: Chuck Hill wrote: On Jan 8, 2008, at 9:23 PM, Peter Vandoros wrote: I came across an interesting behaviour today with awakeFromInsertion() that i did not expect and I hope someone could shed some light. What happens is that

Re: Unexpected awakeFromInsertion() behaviour

2008-01-09 Thread Peter Vandoros
Hi Chuck, Chuck Hill wrote: Hi Peter, On Jan 9, 2008, at 2:49 PM, Peter Vandoros wrote: Chuck Hill wrote: On Jan 8, 2008, at 9:23 PM, Peter Vandoros wrote: I came across an interesting behaviour today with awakeFromInsertion() that i did not expect and I

Unexpected awakeFromInsertion() behaviour

2008-01-08 Thread Peter Vandoros
Hi List, I came across an interesting behaviour today with awakeFromInsertion() that i did not expect and I hope someone could shed some light. What happens is that awakeFromInsertion() is not only called when the EO is created but also when reverting the editing context after having