Re: Can't insert eos on 5.1 win2k

Chuck Hill <[email protected]>
Newsgroups gmane.comp.web.webobjects.eof,gmane.comp.web.webobjects.devel
Organization Global Village Consulting, Inc.
Message-ID <[email protected]>
Are you doing anything with the shared editing context?

Is this EOEntity marked as cached in the EOModel?

Are you setting any relationships in the awakeFromInsertion method of DeployLogEO?

Why are you using
   logRec.takeValueForKey(curDate, "logdatetime");
instead of
   logRec.setLogdatetime(curDate);
?

What is the superclass of DeployLogEO?


Chuck

Hordur Thordarson wrote:

> Thanks for the suggestion Chuck.  I'll try it tomorrow.  This is the 
> 10th version of this code however :-(  One version did a 
> .createAndInsert first and then modified the resulting eo and then saved 
> the changes.
> 
> The saveChanges() call is the one that causes the exception btw.
> 
> Hordur
> 
> On Mánudagur, sep 30, 2002, at 21:04 Atlantic/Reykjavik, Chuck Hill wrote:
> 
>> I don't know about your exact error but calling willChange() seems 
>> very unnecessary and you should insert the EO into an EC before doing 
>> anything else.  Try this:
>>
>>      try {
>>          logRec = new DeployLogEO();
>>          this.session().defaultEditingContext().insertObject(logRec);
>>          logRec.takeValueForKey(curDate, "logdatetime");
>>          this.session().defaultEditingContext().saveChanges();
>>      }
>>
>>
>> Chuck
>>
>>
>> Hordur Thordarson wrote:
>>
>>> Hi all,
>>> I'm getting the following error when trying to insert an eo in a new 
>>> wo 5.1 project on win2k:
>>> com.webobjects.foundation.NSForwardException 
>>> [java.lang.IllegalAccessError] try to access field 
>>> com.webobjects.eocontrol.EOSharedEditingContext._sharedLock from 
>>> class com.webobjects.eoaccess._EOGlobalObjectStoreLock
>>> The code that causes the error is:
>>> public WOActionResults defaultAction() {
>>>     DeployLogEO logRec;
>>>     NSTimestamp curDate = new NSTimestamp();
>>>     try {
>>>         logRec = new DeployLogEO();
>>>         logRec.willChange();
>>>         logRec.takeValueForKey(curDate, "logdatetime");
>>>         this.session().defaultEditingContext().insertObject(logRec);
>>>         this.session().defaultEditingContext().saveChanges();
>>>     }
>>>     catch (Exception e) {
>>>         System.out.println(e.toString());
>>>     }
>>> }
>>> I just put this into a new project with a new eomodel and everything 
>>> (was happening in a project converted from 4.5 to 5.1) but no luck.  
>>> Is my installation messed up or smth ?  There are 2 other reports of 
>>> this bug on the wodev list but neither seems to have been answered 
>>> (last one was today or yesterday).
>>> All hints and suggestions appreciated.
>>> Thanks,
>>> Hordur Thordarson
>>> Smartkort hf.
>>> _______________________________________________
>>> EOF mailing list
>>> [email protected]
>>> http://www.omnigroup.com/mailman/listinfo/eof
>>
>>
>>
>> -- 
>>
>> Chuck Hill                                 [email protected]
>> Global Village Consulting Inc.             http://www.global-village.net
>>
>>
>>
>> _______________________________________________
>> WebObjects-dev mailing list
>> [email protected]
>> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
>>
> 
> 


-- 

Chuck Hill                                 [email protected]
Global Village Consulting Inc.             http://www.global-village.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.