Re: Session IDs in Cookies

2009-04-28 Thread David Avendasora


On Apr 27, 2009, at 5:12 PM, Chuck Hill wrote:



On Apr 27, 2009, at 1:58 PM, Guido Neitzer wrote:


That should be Cookies for everybody ...


No, that is David Avendasora's line.  :-P


You beet me to it!

You know I'd be happy to provide cookies for everybody and have a few  
cases of cookies shipped to WOWODC, but I'm guessing the hotel has a  
no outside food rule.


And as much as I've tried (you know I have) I just can't find the  
right combination of cookies and beer so I don't think it would work  
for a pre-WOWODC party either.


I'd still be happy to get a bunch shipped, if there's a point during  
WOWODC where we could easily distribute them.


Dave







On 27. Apr. 2009, at 13:03 , Mike Schrag wrote:


cookies for everything ...

On Apr 27, 2009, at 3:48 PM, Chuck Hill wrote:

Cookies, unless I have a compelling reason to not use them.  It  
has been years since I worked on an app that did not use cookies.



On Apr 27, 2009, at 12:14 PM, John Huss wrote:


So which do you guys typically use?

John

On Mon, Apr 27, 2009 at 1:43 PM, Chuck Hill ch...@global-village.net 
 wrote:


On Apr 27, 2009, at 11:39 AM, Mike Schrag wrote:

Pros of Cookies
1) stateful DA urls are bookmarkable without junk in them
2) people love to send eachother URLs and nothing sucks worse  
than when they don't understand that it's a huge security risk  
to include your session id


3) You can navigate back and forth between your app and static  
pages and not lose your session





Cons of Cookies
1) opening multiple windows on your app is a lot more annoying  
because they will share the same set of cookies (so you can't  
easily login as two different people in dev mode)
2) if you have any issues with host names (you probably have  
other problems if this is the case), you can lose your cookies  
if the host name changes on you


On Apr 27, 2009, at 2:33 PM, Kieran Kelleher wrote:

What are the benefits of using SessionIDs in cookies over  
WebObjects' default sessionID in URL strategy?


-Kieran
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com

This email sent to msch...@mdimension.com


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to ch...@global-village.net


--
Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/johnthuss%40gmail.com

This email sent to johnth...@gmail.com

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to ch...@global-village.net


--
Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com

This email sent to msch...@mdimension.com



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/guido.neitzer%40gmail.com

This email sent to guido.neit...@gmail.com


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to ch...@global-village.net



--
Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list   

Re: [ANN] AjaxDatePicker and AjaxDefaultSubmitButton

2009-04-28 Thread Travis Britt

On Mar 27, 2009, at 11:02 AM, Chuck Hill wrote:
One other thing is when you reopen the AMD a second time (without  
doing a page refresh) the css will be lost. To fix it I adding the  
css in the appendToResponse of the AMD with ERXResponseRewriter,  
just like your note about putting the javascript in there. Now it  
looks like its working.


I don't see this problem.  Is this only after using the close link?   
If I close it using my controls, and open it again, it looks as it  
did the first time.



First of all, thanks Chuck for wiring this up!

I was able to reproduce this issue by using AjaxDatePicker in a form  
on an AjaxTabbedPanel. If the AjaxDatePicker is not on the initially  
selected tab, and is updated via Ajax (for example, an ajax form  
submit) the next time the calendar is activated it has lost its css.


Not sure *why* this happens yet, but was able to work around it by  
using ERXResponseRewriter to add the calendar's css in the page  
component containing the AjaxTabbedPanel.


tb

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Inverse Relationships

2009-04-28 Thread Mr. Frank Cobia
If I am using the EOGenerator files from WOLips is there not a way to  
update a relationship without automatically updating the inverse  
relationship? If I just call setProperty() then the inverse  
relationship will get called. I had thought if I called  
setPropertyRelationship() with  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=false I  
would get the desired behavior, but it seems that  
setPropertyRelationship() always updates the inverse relationship. For  
example:


  public void  
setSetasideCodeRelationship(com.ods.wo.bids.db.SetasideCode value) {

if (_Bid.LOG.isDebugEnabled()) {
  _Bid.LOG.debug(updating setasideCode from  + setasideCode() +  
 to  + value);

}
if  
(er 
.extensions 
.eof 
.ERXGenericRecord 
.InverseRelationshipUpdater.updateInverseRelationships()) {

setSetasideCode(value);
}
else if (value == null) {
com.ods.wo.bids.db.SetasideCode oldValue = setasideCode();
if (oldValue != null) {
		removeObjectFromBothSidesOfRelationshipWithKey(oldValue,  
setasideCode);

  }
} else {
addObjectToBothSidesOfRelationshipWithKey(value, setasideCode);
}
  }



So even if  
er.extensions.ERXEnterpriseObject.updateInverseRelationships is false  
it still calls either addObjectsToBothSidesOfRelationshipWithKey() or  
removeObjectFromBothSidesOfRelationshipWithKey(). Is this correct? If  
so, is there a way to do this through the generated files?


Thanks,
Frank ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Inverse Relationships

2009-04-28 Thread David Avendasora

Hi Frank,

On Apr 28, 2009, at 10:12 AM, Mr. Frank Cobia wrote:

If I am using the EOGenerator files from WOLips is there not a way  
to update a relationship without automatically updating the inverse  
relationship? If I just call setProperty() then the inverse  
relationship will get called.


I believe this will only update the inverse if you have the  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=true set.  
Otherwise it should only call takeStoredValueForKey(aValue,  
Property) and stop.


I had thought if I called setPropertyRelationship() with  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=false I  
would get the desired behavior, but it seems that  
setPropertyRelationship() always updates the inverse relationship.


You have it backwards. The setPropertyRelationship() _explicitly_ sets  
the inverse, and the updateInverseRelationship will have no effect on  
it.


So, in short, if you want to have control over setting one side only  
of a relationship, use either of the following _Without_ the  
updateInverseRelationship=true:


takeStoredValueForKey(aValue, Key);

or

setProperty(aValue);

Dave


For example:

  public void  
setSetasideCodeRelationship(com.ods.wo.bids.db.SetasideCode value) {

if (_Bid.LOG.isDebugEnabled()) {
  _Bid.LOG.debug(updating setasideCode from  + setasideCode()  
+  to  + value);

}
if  
(er 
.extensions 
.eof 
.ERXGenericRecord 
.InverseRelationshipUpdater.updateInverseRelationships()) {

setSetasideCode(value);
}
else if (value == null) {
com.ods.wo.bids.db.SetasideCode oldValue = setasideCode();
if (oldValue != null) {
		removeObjectFromBothSidesOfRelationshipWithKey(oldValue,  
setasideCode);

  }
} else {
addObjectToBothSidesOfRelationshipWithKey(value, setasideCode);
}
  }



So even if  
er.extensions.ERXEnterpriseObject.updateInverseRelationships is  
false it still calls either  
addObjectsToBothSidesOfRelationshipWithKey() or  
removeObjectFromBothSidesOfRelationshipWithKey(). Is this correct?  
If so, is there a way to do this through the generated files?


Thanks,
Frank
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com

This email sent to webobje...@avendasora.com


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Inverse Relationships

2009-04-28 Thread Stamenkovic Florijan

On Apr 28, 2009, at 10:12, Mr. Frank Cobia wrote:

If I am using the EOGenerator files from WOLips is there not a way  
to update a relationship without automatically updating the inverse  
relationship?


For to ones you can use takeStoredValueForKey(...)

For to manys you can use includeObjectIntoPropertyWithKey(...) and  
excludeObjectFromPropertyWithKey(...)


None of these methods will touch the inverse relationship.

If these methods aren't good enough to do what you want, please  
elaborate on your situation.


F

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Inverse Relationships

2009-04-28 Thread Mr. Frank Cobia

Thank you. That fixed it. I did have it backwards.

Frank


On Apr 28, 2009, at 10:23 AM, David Avendasora wrote:


Hi Frank,

On Apr 28, 2009, at 10:12 AM, Mr. Frank Cobia wrote:

If I am using the EOGenerator files from WOLips is there not a way  
to update a relationship without automatically updating the inverse  
relationship? If I just call setProperty() then the inverse  
relationship will get called.


I believe this will only update the inverse if you have the  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=true  
set. Otherwise it should only call takeStoredValueForKey(aValue,  
Property) and stop.


I had thought if I called setPropertyRelationship() with  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=false  
I would get the desired behavior, but it seems that  
setPropertyRelationship() always updates the inverse relationship.


You have it backwards. The setPropertyRelationship() _explicitly_  
sets the inverse, and the updateInverseRelationship will have no  
effect on it.


So, in short, if you want to have control over setting one side only  
of a relationship, use either of the following _Without_ the  
updateInverseRelationship=true:


takeStoredValueForKey(aValue, Key);

or

setProperty(aValue);

Dave


For example:

  public void  
setSetasideCodeRelationship(com.ods.wo.bids.db.SetasideCode value) {

if (_Bid.LOG.isDebugEnabled()) {
  _Bid.LOG.debug(updating setasideCode from  + setasideCode()  
+  to  + value);

}
if  
(er 
.extensions 
.eof 
.ERXGenericRecord 
.InverseRelationshipUpdater.updateInverseRelationships()) {

setSetasideCode(value);
}
else if (value == null) {
com.ods.wo.bids.db.SetasideCode oldValue = setasideCode();
if (oldValue != null) {
		removeObjectFromBothSidesOfRelationshipWithKey(oldValue,  
setasideCode);

  }
} else {
	addObjectToBothSidesOfRelationshipWithKey(value,  
setasideCode);

}
  }



So even if  
er.extensions.ERXEnterpriseObject.updateInverseRelationships is  
false it still calls either  
addObjectsToBothSidesOfRelationshipWithKey() or  
removeObjectFromBothSidesOfRelationshipWithKey(). Is this correct?  
If so, is there a way to do this through the generated files?


Thanks,
Frank
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com

This email sent to webobje...@avendasora.com




 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Inverse Relationships

2009-04-28 Thread Mr. Frank Cobia
Sorry, I need a little more help. I understand this, but I would like  
to keep the updateReverseRelationships=true for the app, but in one  
situation I would like to set the relationship without updating the  
reverse. Is it possible to do this?


Thanks,
Frank


On Apr 28, 2009, at 10:23 AM, David Avendasora wrote:


Hi Frank,

On Apr 28, 2009, at 10:12 AM, Mr. Frank Cobia wrote:

If I am using the EOGenerator files from WOLips is there not a way  
to update a relationship without automatically updating the inverse  
relationship? If I just call setProperty() then the inverse  
relationship will get called.


I believe this will only update the inverse if you have the  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=true  
set. Otherwise it should only call takeStoredValueForKey(aValue,  
Property) and stop.


I had thought if I called setPropertyRelationship() with  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=false  
I would get the desired behavior, but it seems that  
setPropertyRelationship() always updates the inverse relationship.


You have it backwards. The setPropertyRelationship() _explicitly_  
sets the inverse, and the updateInverseRelationship will have no  
effect on it.


So, in short, if you want to have control over setting one side only  
of a relationship, use either of the following _Without_ the  
updateInverseRelationship=true:


takeStoredValueForKey(aValue, Key);

or

setProperty(aValue);

Dave


For example:

  public void  
setSetasideCodeRelationship(com.ods.wo.bids.db.SetasideCode value) {

if (_Bid.LOG.isDebugEnabled()) {
  _Bid.LOG.debug(updating setasideCode from  + setasideCode()  
+  to  + value);

}
if  
(er 
.extensions 
.eof 
.ERXGenericRecord 
.InverseRelationshipUpdater.updateInverseRelationships()) {

setSetasideCode(value);
}
else if (value == null) {
com.ods.wo.bids.db.SetasideCode oldValue = setasideCode();
if (oldValue != null) {
		removeObjectFromBothSidesOfRelationshipWithKey(oldValue,  
setasideCode);

  }
} else {
	addObjectToBothSidesOfRelationshipWithKey(value,  
setasideCode);

}
  }



So even if  
er.extensions.ERXEnterpriseObject.updateInverseRelationships is  
false it still calls either  
addObjectsToBothSidesOfRelationshipWithKey() or  
removeObjectFromBothSidesOfRelationshipWithKey(). Is this correct?  
If so, is there a way to do this through the generated files?


Thanks,
Frank
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com

This email sent to webobje...@avendasora.com




 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Inverse Relationships

2009-04-28 Thread Mike Schrag
currently not directly .. it's an all-or-nothing setting.  you would  
need to remove the inverse relationship from the model to turn it off.  
you MIGHT be able to manually do a  
_setUpdateInverseRelationships(false) (or whatever that method is  
called) on the EO before you set the relationship in question, but  
make sure you put the thing to turn it back on in a finally block.


ms

On Apr 28, 2009, at 10:59 AM, Mr. Frank Cobia wrote:

Sorry, I need a little more help. I understand this, but I would  
like to keep the updateReverseRelationships=true for the app, but in  
one situation I would like to set the relationship without updating  
the reverse. Is it possible to do this?


Thanks,
Frank


On Apr 28, 2009, at 10:23 AM, David Avendasora wrote:


Hi Frank,

On Apr 28, 2009, at 10:12 AM, Mr. Frank Cobia wrote:

If I am using the EOGenerator files from WOLips is there not a way  
to update a relationship without automatically updating the  
inverse relationship? If I just call setProperty() then the  
inverse relationship will get called.


I believe this will only update the inverse if you have the  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=true  
set. Otherwise it should only call takeStoredValueForKey(aValue,  
Property) and stop.


I had thought if I called setPropertyRelationship() with  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=false  
I would get the desired behavior, but it seems that  
setPropertyRelationship() always updates the inverse relationship.


You have it backwards. The setPropertyRelationship() _explicitly_  
sets the inverse, and the updateInverseRelationship will have no  
effect on it.


So, in short, if you want to have control over setting one side  
only of a relationship, use either of the following _Without_ the  
updateInverseRelationship=true:


takeStoredValueForKey(aValue, Key);

or

setProperty(aValue);

Dave


For example:

  public void  
setSetasideCodeRelationship(com.ods.wo.bids.db.SetasideCode value) {

if (_Bid.LOG.isDebugEnabled()) {
  _Bid.LOG.debug(updating setasideCode from  +  
setasideCode() +  to  + value);

}
if  
(er 
.extensions 
.eof 
.ERXGenericRecord 
.InverseRelationshipUpdater.updateInverseRelationships()) {

setSetasideCode(value);
}
else if (value == null) {
com.ods.wo.bids.db.SetasideCode oldValue = setasideCode();
if (oldValue != null) {
		removeObjectFromBothSidesOfRelationshipWithKey(oldValue,  
setasideCode);

  }
} else {
	addObjectToBothSidesOfRelationshipWithKey(value,  
setasideCode);

}
  }



So even if  
er.extensions.ERXEnterpriseObject.updateInverseRelationships is  
false it still calls either  
addObjectsToBothSidesOfRelationshipWithKey() or  
removeObjectFromBothSidesOfRelationshipWithKey(). Is this correct?  
If so, is there a way to do this through the generated files?


Thanks,
Frank
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com

This email sent to webobje...@avendasora.com




___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com

This email sent to msch...@mdimension.com


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: exception with a not null constraint....

2009-04-28 Thread Chuck Hill

Please keep messages on the list.


On Apr 28, 2009, at 4:12 AM, Theodore Petrosky wrote:



ok here we go...

I create a table with a repetition:
table
  wo:WORepetition list = $dg.displayedObjects item = $current
//$current is of type Contact (it has the column dateInserted

I have in here an AjaxModalContainer. (label  
=$current.companyName) ... click a companyName and get the modal  
dialog to edit the meta data

so far everything is ok.


/table

interesting that I stuck a comment at the head of my saveEdits  
function


top of saveEditsToContact +
Apr 28 06:48:59 AffluentCooperative[50613] INFO  NSLog  -  
current.dateInserted() = 2009-04-25 04:00:00 Etc/GMT


current.dateInserted has a value however in the actual try block

INFO  NSLog  - ValidationException e = Please provide a bDate  
Inserted/b.


I know that I would be thoroughly embarrassed to have a anyone  
actually look at my code, but I can export the whole project and let  
you see what I am doing. I use postgresql and migrations.


I don't get this

Ted



--- On Mon, 4/27/09, Chuck Hill ch...@global-village.net wrote:


From: Chuck Hill ch...@global-village.net
Subject: Re: exception with a not null constraint
To: Theodore Petrosky tedp...@yahoo.com
Cc: webobjects-dev@lists.apple.com
Date: Monday, April 27, 2009, 2:08 PM

On Apr 25, 2009, at 6:09 AM, Theodore Petrosky wrote:



I have an EO with a not null constraint on a date

columnn. I have a function that I call from a click that
sets a boolean (isDeleted) to true and saves the EO.


try {
   contactEO.saveChanges();
} catch (ValidationException e) {


NSLog.out.appendln(ValidationException e =  +
e.getMessage());


} catch (EOGeneralAdaptorException e) {


NSLog.out.appendln(EOGeneralAdaptorException e =  +
e.getMessage());

}
}

It is throwing an exception and claiming that the date

field is null

Does the model allow null for this attribute?  Did you
change the model after creating the database?



and violates the not null constraint. I don't have

anyplace in the interface that is wired to the date column
in question (it is the insertion date).


I guess I could just set the EO to accept nulls but I

thought I would try to understand why the saveChanges() is
trying to update the row with a null.


You are doing something wrong, either in your model or in
your code (or, I guess, in both).  This is the first
thing to check:
http://wiki.objectstyle.org/confluence/display/WO/EOF-Using+EOF-The+EOF+Commandments

Chuck

--Chuck Hill
  Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/









--
Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Inverse Relationships

2009-04-28 Thread Mr. Frank Cobia
Thanks. I was going to just remove the reverse relationship, but there  
is actually a place where I do a query that uses the inverse  
relationship. So my solution, which seems to work, is to remove the  
class property flag for the inverse relationship. The only downside I  
have come across is that there is then no ERXKey generated for that  
inverse relationship.


Is there a way to have an ERXKey generated for a non-class property or  
am I stuck adding it by hand?


Thanks,
Frank


On Apr 28, 2009, at 11:06 AM, Mike Schrag wrote:

currently not directly .. it's an all-or-nothing setting.  you would  
need to remove the inverse relationship from the model to turn it  
off. you MIGHT be able to manually do a  
_setUpdateInverseRelationships(false) (or whatever that method is  
called) on the EO before you set the relationship in question, but  
make sure you put the thing to turn it back on in a finally block.


ms

On Apr 28, 2009, at 10:59 AM, Mr. Frank Cobia wrote:

Sorry, I need a little more help. I understand this, but I would  
like to keep the updateReverseRelationships=true for the app, but  
in one situation I would like to set the relationship without  
updating the reverse. Is it possible to do this?


Thanks,
Frank


On Apr 28, 2009, at 10:23 AM, David Avendasora wrote:


Hi Frank,

On Apr 28, 2009, at 10:12 AM, Mr. Frank Cobia wrote:

If I am using the EOGenerator files from WOLips is there not a  
way to update a relationship without automatically updating the  
inverse relationship? If I just call setProperty() then the  
inverse relationship will get called.


I believe this will only update the inverse if you have the  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=true  
set. Otherwise it should only call takeStoredValueForKey(aValue,  
Property) and stop.


I had thought if I called setPropertyRelationship() with  
er 
.extensions.ERXEnterpriseObject.updateInverseRelationships=false  
I would get the desired behavior, but it seems that  
setPropertyRelationship() always updates the inverse relationship.


You have it backwards. The setPropertyRelationship() _explicitly_  
sets the inverse, and the updateInverseRelationship will have no  
effect on it.


So, in short, if you want to have control over setting one side  
only of a relationship, use either of the following _Without_ the  
updateInverseRelationship=true:


takeStoredValueForKey(aValue, Key);

or

setProperty(aValue);

Dave


For example:

  public void  
setSetasideCodeRelationship(com.ods.wo.bids.db.SetasideCode  
value) {

if (_Bid.LOG.isDebugEnabled()) {
  _Bid.LOG.debug(updating setasideCode from  +  
setasideCode() +  to  + value);

}
if  
(er 
.extensions 
.eof 
.ERXGenericRecord 
.InverseRelationshipUpdater.updateInverseRelationships()) {

setSetasideCode(value);
}
else if (value == null) {
com.ods.wo.bids.db.SetasideCode oldValue = setasideCode();
if (oldValue != null) {
		removeObjectFromBothSidesOfRelationshipWithKey(oldValue,  
setasideCode);

  }
} else {
	addObjectToBothSidesOfRelationshipWithKey(value,  
setasideCode);

}
  }



So even if  
er.extensions.ERXEnterpriseObject.updateInverseRelationships is  
false it still calls either  
addObjectsToBothSidesOfRelationshipWithKey() or  
removeObjectFromBothSidesOfRelationshipWithKey(). Is this  
correct? If so, is there a way to do this through the generated  
files?


Thanks,
Frank
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com

This email sent to webobje...@avendasora.com




___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com

This email sent to msch...@mdimension.com


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/frank.cobia%40f2technology.com

This email sent to frank.co...@f2technology.com


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Inverse Relationships

2009-04-28 Thread Ricardo J. Parada

I would add it by hand to your Entity.java file.  ;-)



On Apr 28, 2009, at 1:10 PM, Mr. Frank Cobia wrote:

Thanks. I was going to just remove the reverse relationship, but  
there is actually a place where I do a query that uses the inverse  
relationship. So my solution, which seems to work, is to remove the  
class property flag for the inverse relationship. The only downside  
I have come across is that there is then no ERXKey generated for  
that inverse relationship.


Is there a way to have an ERXKey generated for a non-class property  
or am I stuck adding it by hand?


Thanks,
Frank


On Apr 28, 2009, at 11:06 AM, Mike Schrag wrote:

currently not directly .. it's an all-or-nothing setting.  you  
would need to remove the inverse relationship from the model to  
turn it off. you MIGHT be able to manually do a  
_setUpdateInverseRelationships(false) (or whatever that method is  
called) on the EO before you set the relationship in question, but  
make sure you put the thing to turn it back on in a finally block.


ms

On Apr 28, 2009, at 10:59 AM, Mr. Frank Cobia wrote:

Sorry, I need a little more help. I understand this, but I would  
like to keep the updateReverseRelationships=true for the app, but  
in one situation I would like to set the relationship without  
updating the reverse. Is it possible to do this?


Thanks,
Frank


On Apr 28, 2009, at 10:23 AM, David Avendasora wrote:


Hi Frank,

On Apr 28, 2009, at 10:12 AM, Mr. Frank Cobia wrote:

If I am using the EOGenerator files from WOLips is there not a  
way to update a relationship without automatically updating the  
inverse relationship? If I just call setProperty() then the  
inverse relationship will get called.


I believe this will only update the inverse if you have the  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=true  
set. Otherwise it should only call takeStoredValueForKey(aValue,  
Property) and stop.


I had thought if I called setPropertyRelationship() with  
er 
.extensions.ERXEnterpriseObject.updateInverseRelationships=false  
I would get the desired behavior, but it seems that  
setPropertyRelationship() always updates the inverse relationship.


You have it backwards. The setPropertyRelationship() _explicitly_  
sets the inverse, and the updateInverseRelationship will have no  
effect on it.


So, in short, if you want to have control over setting one side  
only of a relationship, use either of the following _Without_ the  
updateInverseRelationship=true:


takeStoredValueForKey(aValue, Key);

or

setProperty(aValue);

Dave


For example:

  public void  
setSetasideCodeRelationship(com.ods.wo.bids.db.SetasideCode  
value) {

if (_Bid.LOG.isDebugEnabled()) {
  _Bid.LOG.debug(updating setasideCode from  +  
setasideCode() +  to  + value);

}
if  
(er 
.extensions 
.eof 
.ERXGenericRecord 
.InverseRelationshipUpdater.updateInverseRelationships()) {

setSetasideCode(value);
}
else if (value == null) {
com.ods.wo.bids.db.SetasideCode oldValue = setasideCode();
if (oldValue != null) {
		removeObjectFromBothSidesOfRelationshipWithKey(oldValue,  
setasideCode);

  }
} else {
	addObjectToBothSidesOfRelationshipWithKey(value,  
setasideCode);

}
  }



So even if  
er.extensions.ERXEnterpriseObject.updateInverseRelationships is  
false it still calls either  
addObjectsToBothSidesOfRelationshipWithKey() or  
removeObjectFromBothSidesOfRelationshipWithKey(). Is this  
correct? If so, is there a way to do this through the generated  
files?


Thanks,
Frank
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com

This email sent to webobje...@avendasora.com




___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com

This email sent to msch...@mdimension.com


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/frank.cobia%40f2technology.com

This email sent to frank.co...@f2technology.com


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/rparada 
%40mac.com


This email sent to rpar...@mac.com


 

Re: Inverse Relationships

2009-04-28 Thread Mike Schrag
Is there a way to have an ERXKey generated for a non-class property  
or am I stuck adding it by hand?
sort of defeats the purpose of being non class :)  there's nothing  
magical about them, though -- new ERXKeywhatever(keyname).


ms

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Waiting for Request with JDBCAdaptorException

2009-04-28 Thread Chuck Hill

Please keep messages on the list.


On Apr 27, 2009, at 10:05 PM, T R T wrote:


Hi Chunk,



Chuck.  Please.

I am new to webobject environment and have to make it working for  
one project in Mac OS Xserver 10.5.6. The version of the webobject  
is 5.4.3. The database server is mysql in another server- linux. The  
mysql connection is working fine between Mac and linux. The  
application has been configured and started using Java Monitor  
without problem. But when I try to connect to the application  
(http://.../cgi-bin/WebObjects/. ) it produce “An Internal  
Server Error...”.



That means your application threw an exception.


The application log shows the exception below and the wotaskd log  
keep “waiting for request”. The netsta showing the following:


 t2gtestnz:~ sysas$ netstat -an | grep 1085

tcp4   0  0  10.50.6.18.1085   10.50.6.18.49517   
ESTABLISHED


tcp4   0  0  10.50.6.18.49517  10.50.6.18.1085
ESTABLISHED


tcp4   0  0  10.50.6.18.1085   10.50.6.18.49161   
ESTABLISHED


tcp4   0  0  10.50.6.18.49161  10.50.6.18.1085
ESTABLISHED


tcp4   0  0  *.1085 *.* 
LISTEN


tcp4   0  0  10.50.6.18.1085   10.50.6.18.49537   
TIME_WAIT


udp4   0  0  *.1085 *.*

 I checked your group and there might be similar problem in the  
archive, but there was not exactly the same problem although it was  
useful to check some configuration which was fine in my case.


The Exception:

[2009-04-25 14:31:01 NZST] WorkerThread1  
com.webobjects.appserver._private.WOComponentRequestHandler:  
Exception occurred while handling request:


com.webobjects.foundation.NSForwardException  
[com.webobjects.jdbcadaptor.JDBCAdaptorException] null


[2009-04-25 14:31:01 NZST] WorkerThread1 WOWorkerThread id=1  
socket=Socket[addr=/10.50.6.18,port=51504,localport=2001] Exception  
occurred while responding to client:  
com.webobjects.foundation.NSForwardException  
[com.webobjects.jdbcadaptor.JDBCAdaptorException] null


I have no idea what that is.  You will need to catch the exception  
(try in dispatchRequest) and drill down into the NSForwardException  
and log out the details.


ERXJDBCConnectionAnalyzer from Project Wonder might help you here.


Chuck


default session timeout is 3600.0

session timeout is now 3600.0

I really need help to make this working. Thank you in advance.

Tony



Get fit, feel better! All the help you need at Yahoo!Xtra Health


--
Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Entity Modeler

2009-04-28 Thread Dino Strausz

Hola t...@s!

Is it me, or the reverse engine of Entity Modeller is not working?

here an error:

java.lang.NoClassDefFoundError: org/eclipse/jdt/debug/ui/ 
launchConfigurations/JavaApplicationLaunchShortcut

at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
	at  
org 
.eclipse 
.osgi 
.internal 
.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:161)
	at  
org 
.eclipse 
.osgi 
.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java: 
501)
	at  
org 
.eclipse 
.osgi 
.baseadaptor 
.loader.ClasspathManager.findClassImpl(ClasspathManager.java:471)
	at  
org 
.eclipse 
.osgi 
.baseadaptor 
.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:430)
	at  
org 
.eclipse 
.osgi 
.baseadaptor 
.loader.ClasspathManager.findLocalClass(ClasspathManager.java:413)
	at  
org 
.eclipse 
.osgi 
.internal 
.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java: 
189)
	at  
org 
.eclipse 
.osgi 
.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java: 
340)
	at  
org 
.eclipse 
.osgi 
.framework 
.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java: 
37)
	at  
org 
.eclipse 
.osgi 
.framework 
.internal.core.BundleLoader.findClassInternal(BundleLoader.java:405)
	at  
org 
.eclipse 
.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java: 
369)
	at  
org 
.eclipse 
.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java: 
357)
	at  
org 
.eclipse 
.osgi 
.internal 
.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
	at  
org 
.objectstyle 
.wolips 
.eomodeler 
.eclipse 
.EclipseEOClassLoaderFactory 
.fillInModelClasspath(EclipseEOClassLoaderFactory.java:68)
	at  
org 
.objectstyle 
.wolips 
.eomodeler 
.core 
.model 
.AbstractEOClassLoader 
.createClassLoaderForModel(AbstractEOClassLoader.java:29)
	at org.objectstyle.wolips.eomodeler.core.model.IEOClassLoaderFactory 
$Utility.createClassLoader(IEOClassLoaderFactory.java:40)
	at  
org 
.objectstyle 
.wolips 
.eomodeler 
.actions.ReverseEngineerAction.run(ReverseEngineerAction.java:110)
	at  
org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:256)
	at  
org 
.eclipse 
.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
	at  
org 
.eclipse 
.jface 
.action 
.ActionContributionItem 
.handleWidgetSelection(ActionContributionItem.java:546)
	at org.eclipse.jface.action.ActionContributionItem.access 
$2(ActionContributionItem.java:490)
	at org.eclipse.jface.action.ActionContributionItem 
$6.handleEvent(ActionContributionItem.java:443)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1495)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1519)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1504)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1295)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3350)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2950)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at  
org 
.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java: 
289)
	at  
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java: 
461)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at  
org 
.eclipse 
.ui.internal.ide.application.IDEApplication.start(IDEApplication.java: 
106)
	at  
org 
.eclipse 
.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
	at  
org 
.eclipse 
.core 
.runtime 
.internal 
.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at  
org 
.eclipse 
.core 
.runtime 
.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at  
org 
.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java: 
363)
	at  
org 
.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java: 
176)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at  
sun 
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 
39)
	at  
sun 
.reflect 
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 
25)

at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)



Dino
--

EOF issues

2009-04-28 Thread M.Y. Tjoe

Hi all,

I am currently investigating an interesting problem. Here is the  
problem description:


A database table Person is represented in EOModel as Person with 3  
childs  Staff , Student, External. There is type column in  
Person to tell if he is staff/student/external.


The problem is that when a External object is fetched into a ec,  
changed its type to student and saved changes,


i.e.

External external = External.fetchExternal(ec, External.ID_KEY,  
'12345');

external.setType(student);
external.editingContext().saveChanges();

then in the same ec (or different ec) the now student still being  
recognized as External somehow.


When you do

Student student = Student.fetchRequiredStudent(ec, Student.ID_KEY,  
'12345');

or even
Person student = Person.fetchRequiredPerson(ec, Person.ID_KEY, '12345');

An databaseContextFailedToFetchObject exception is thrown.

I am thinking the objects graph is now broken because Staff Object  
supposed to be vanished from the graph but it didn't.


Any idea??

Regards,
Harvey

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: EOF issues

2009-04-28 Thread Ken Anderson

Harvey,

There are many discussions about this in the history, but the basic  
idea is this - EOF doesn't like changing attributes that determine the  
class/entity of an object.  The general consensus from the last time  
this came up is, change how you do things so you don't have to do this.


How much behavior is actually different here?  Do you really need sub- 
entities for this?  I remember a discussion at WWDC a number of years  
ago where the iTunes team said that out of 400 entities, they only had  
2 sets of object hierarchies.


One way I approach different behaviors when I don't want sub-entities  
is to have a set of objects that do the special work you'd have a  
subclass do, and have it determine which one to use dynamically.  For  
instance, if the type is Student (right now) and you ask how many  
classes it is taking, the helper class could make that determination  
and return the result.  You can use key-value coding to make this  
nearly transparent to the users of the Person object.


Ken

On Apr 28, 2009, at 10:31 PM, M.Y. Tjoe wrote:


Hi all,

I am currently investigating an interesting problem. Here is the  
problem description:


A database table Person is represented in EOModel as Person with  
3 childs  Staff , Student, External. There is type column in  
Person to tell if he is staff/student/external.


The problem is that when a External object is fetched into a ec,  
changed its type to student and saved changes,


i.e.

External external = External.fetchExternal(ec, External.ID_KEY,  
'12345');

external.setType(student);
external.editingContext().saveChanges();

then in the same ec (or different ec) the now student still being  
recognized as External somehow.


When you do

Student student = Student.fetchRequiredStudent(ec, Student.ID_KEY,  
'12345');

or even
Person student = Person.fetchRequiredPerson(ec, Person.ID_KEY,  
'12345');


An databaseContextFailedToFetchObject exception is thrown.

I am thinking the objects graph is now broken because Staff Object  
supposed to be vanished from the graph but it didn't.


Any idea??

Regards,
Harvey

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com

This email sent to kenli...@anderhome.com


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: EOF issues

2009-04-28 Thread Chuck Hill


On Apr 28, 2009, at 7:31 PM, M.Y. Tjoe wrote:


Hi all,

I am currently investigating an interesting problem. Here is the  
problem description:


A database table Person is represented in EOModel as Person with  
3 childs  Staff , Student, External. There is type column in  
Person to tell if he is staff/student/external.


The problem is that when a External object is fetched into a ec,  
changed its type to student and saved changes,


You cannot, may not, must not change the type of an object.  Look at a  
Role pattern instead.


Chuck





i.e.

External external = External.fetchExternal(ec, External.ID_KEY,  
'12345');

external.setType(student);
external.editingContext().saveChanges();

then in the same ec (or different ec) the now student still being  
recognized as External somehow.


When you do

Student student = Student.fetchRequiredStudent(ec, Student.ID_KEY,  
'12345');

or even
Person student = Person.fetchRequiredPerson(ec, Person.ID_KEY,  
'12345');


An databaseContextFailedToFetchObject exception is thrown.

I am thinking the objects graph is now broken because Staff Object  
supposed to be vanished from the graph but it didn't.


Any idea??

Regards,
Harvey

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to ch...@global-village.net



--
Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: EOF issues

2009-04-28 Thread Ken Anderson

one fish, two fish, red fish, blue fish.

On Apr 28, 2009, at 10:42 PM, Chuck Hill wrote:



On Apr 28, 2009, at 7:31 PM, M.Y. Tjoe wrote:


Hi all,

I am currently investigating an interesting problem. Here is the  
problem description:


A database table Person is represented in EOModel as Person  
with 3 childs  Staff , Student, External. There is type  
column in Person to tell if he is staff/student/external.


The problem is that when a External object is fetched into a ec,  
changed its type to student and saved changes,


You cannot, may not, must not change the type of an object.  Look at  
a Role pattern instead.


Chuck





i.e.

External external = External.fetchExternal(ec, External.ID_KEY,  
'12345');

external.setType(student);
external.editingContext().saveChanges();

then in the same ec (or different ec) the now student still being  
recognized as External somehow.


When you do

Student student = Student.fetchRequiredStudent(ec, Student.ID_KEY,  
'12345');

or even
Person student = Person.fetchRequiredPerson(ec, Person.ID_KEY,  
'12345');


An databaseContextFailedToFetchObject exception is thrown.

I am thinking the objects graph is now broken because Staff Object  
supposed to be vanished from the graph but it didn't.


Any idea??

Regards,
Harvey

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to ch...@global-village.net



--
Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com

This email sent to kenli...@anderhome.com


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Help with NPE in EOCustomObject.willReadRelationship()

2009-04-28 Thread Peter Vandoros

Hi All,

I have an issue where a NullPointerException is thrown within  
EOCustomObject.willReadRelationship(). Before I log a radar, I want to  
see if anyone else has had a similar issue and if so, what you did to  
resolve it.


I believe the issue is that EOCustomObject.willReadRelationship() is  
called firing a fault on a deleted EO. The only way that  
EOCustomObject.willReadRelationship() will throw a NPE is if  
editingContext() returns null and 'object' is a fault (ie.  
EOFaultHandler.isFault(object) returns true).


What am I doing to cause this sequence of events you ask? it's  
relatively simple:


- I have a class  
(path.to.class.listening.to.editingcontext.notification.MyClass from  
stack trace below) that listens to  
EOEditingContext.EditingContextDidSaveChangesNotification  
notifications and does some processing.
- The NPE occurs in a debug statement that prints the NSNotification  
object passed to my MyClass.editingContextDidSaveChanges() method  
before any processing occurs.
- I tracked down the culprits to be 3 of 10 deleted objects in the  
NSNotification's deleted userInfo key value, throwing NPE's in their  
EOCustomObject.toString() method.


Obviously deleted EO's shouldn't have editingContext()'s, but I  
believe that EOCustomObject.eoDescription() should not fire _any_  
faults or EOCustomObject.willReadRelationship() should check to see if  
editingContext() is null when 'object' is a fault.


I can override EOCustomObject.willReadRelationship() in my super class  
and return null when editingContext() == null   
EOFaultHandler.isFault(object), but I want to know what other  
potential issues this will cause.


Model:

Entity1  Entity2  Entity3

- There are 3 similar relationships between Entity2  Entity3 (used  
for different purposes)


Stacktrace:

java.lang.NullPointerException
	at  
com 
.webobjects 
.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1293)
	at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer 
$ 
_LazyGenericRecordBinding 
.valueInObject(_EOMutableKnownKeyDictionary.java:560)
	at  
com 
.webobjects 
.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1736)
	at  
path 
.to.my.eo.class._Entity3.myToManyRelationshipToEntity2(_AnEntity.java: 
492)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at  
sun 
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 
39)
	at  
sun 
.reflect 
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 
25)

at java.lang.reflect.Method.invoke(Method.java:597)
	at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor 
$1.methodValue(NSKeyValueCoding.java:684)
	at com.webobjects.foundation.NSKeyValueCoding 
$_MethodBinding.valueInObject(NSKeyValueCoding.java:1160)
	at  
com 
.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java: 
1559)
	at  
com 
.webobjects.eocontrol.EOCustomObject.eoDescription(EOCustomObject.java: 
793)
	at  
com.webobjects.eocontrol.EOCustomObject.toString(EOCustomObject.java: 
239)

at com.webobjects.foundation.NSArray.toString(NSArray.java:920)
at java.lang.String.valueOf(String.java:2827)
at java.lang.StringBuffer.append(StringBuffer.java:219)
	at com.webobjects.foundation.NSDictionary.toString(NSDictionary.java: 
541)

at java.lang.String.valueOf(String.java:2827)
at java.lang.StringBuffer.append(StringBuffer.java:219)
	at  
com.webobjects.foundation.NSNotification.toString(NSNotification.java: 
175)
	at  
path 
.to 
.class 
.listening 
.to 
.editingcontext 
.notification 
.MyClass.editingContextDidSaveChanges(EOCacheChangeCollector.java:141)


Regards

Peter Vandoros
Software Engineer
Etech Group Pty Ltd
Level 3/21 Victoria St
Melbourne VIC 3000
Australia

Ph: +61 3 9639 9677
Fax: +61 3 9639 9577
--
IMPORTANT: This e-mail message and any attachments are confidential  
and may be privileged. If received in error, please reply to this  
message and destroy all copies and any attachments. You should check  
this message and any attachments for viruses or defects. Our liability  
is limited to resupplying any affected message or attachments. For  
more information about Etech Group, please visit us at http://www.etechgroup.com.au 
.





___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Help with NPE in EOCustomObject.willReadRelationship()

2009-04-28 Thread Chuck Hill

Hi Peter,


On Apr 28, 2009, at 9:20 PM, Peter Vandoros wrote:


Hi All,

I have an issue where a NullPointerException is thrown within  
EOCustomObject.willReadRelationship(). Before I log a radar, I want  
to see if anyone else has had a similar issue and if so, what you  
did to resolve it.


I believe the issue is that EOCustomObject.willReadRelationship() is  
called firing a fault on a deleted EO. The only way that  
EOCustomObject.willReadRelationship() will throw a NPE is if  
editingContext() returns null and 'object' is a fault (ie.  
EOFaultHandler.isFault(object) returns true).


What am I doing to cause this sequence of events you ask? it's  
relatively simple:


- I have a class  
(path.to.class.listening.to.editingcontext.notification.MyClass from  
stack trace below) that listens to  
EOEditingContext.EditingContextDidSaveChangesNotification  
notifications and does some processing.
- The NPE occurs in a debug statement that prints the NSNotification  
object passed to my MyClass.editingContextDidSaveChanges() method  
before any processing occurs.


That is not going to have happy results...


- I tracked down the culprits to be 3 of 10 deleted objects in the  
NSNotification's deleted userInfo key value, throwing NPE's in  
their EOCustomObject.toString() method.


See!  :-)  Yes, you should not do anything to a deleted object.  It  
makes EOF rather cross.



Obviously deleted EO's shouldn't have editingContext()'s, but I  
believe that EOCustomObject.eoDescription() should not fire _any_  
faults


I don't think that I would agree with that.  The information from  
firing faults can be very useful.  You can certainly re-implement it  
to not fire the faults or output something very limited if  
editingContext() == null.  That is a reasonable suggestion to make in  
a bug report.




or EOCustomObject.willReadRelationship() should check to see if  
editingContext() is null when 'object' is a fault.


And throw an exception.  That is a reasonable suggestion to make in a  
bug report.



I can override EOCustomObject.willReadRelationship() in my super  
class and return null when editingContext() == null   
EOFaultHandler.isFault(object), but I want to know what other  
potential issues this will cause.


That would make me nervous.  If this method is called when  
editingContext() == null, that indicates to me a coding mistake.  An  
exception seems appropriate and the NPE is not exactly helpful.



Chuck





Model:

Entity1  Entity2  Entity3

- There are 3 similar relationships between Entity2  Entity3 (used  
for different purposes)


Stacktrace:

java.lang.NullPointerException
	at  
com 
.webobjects 
.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java: 
1293)
	at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer 
$ 
_LazyGenericRecordBinding 
.valueInObject(_EOMutableKnownKeyDictionary.java:560)
	at  
com 
.webobjects 
.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1736)
	at  
path 
.to 
.my.eo.class._Entity3.myToManyRelationshipToEntity2(_AnEntity.java: 
492)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at  
sun 
.reflect 
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at  
sun 
.reflect 
.DelegatingMethodAccessorImpl 
.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)
	at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor 
$1.methodValue(NSKeyValueCoding.java:684)
	at com.webobjects.foundation.NSKeyValueCoding 
$_MethodBinding.valueInObject(NSKeyValueCoding.java:1160)
	at  
com 
.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java: 
1559)
	at  
com 
.webobjects 
.eocontrol.EOCustomObject.eoDescription(EOCustomObject.java:793)
	at  
com.webobjects.eocontrol.EOCustomObject.toString(EOCustomObject.java: 
239)

at com.webobjects.foundation.NSArray.toString(NSArray.java:920)
at java.lang.String.valueOf(String.java:2827)
at java.lang.StringBuffer.append(StringBuffer.java:219)
	at  
com.webobjects.foundation.NSDictionary.toString(NSDictionary.java:541)

at java.lang.String.valueOf(String.java:2827)
at java.lang.StringBuffer.append(StringBuffer.java:219)
	at  
com 
.webobjects.foundation.NSNotification.toString(NSNotification.java: 
175)
	at  
path 
.to 
.class 
.listening 
.to 
.editingcontext 
.notification 
.MyClass.editingContextDidSaveChanges(EOCacheChangeCollector.java:141)


Regards

Peter Vandoros
Software Engineer
Etech Group Pty Ltd
Level 3/21 Victoria St
Melbourne VIC 3000
Australia

Ph: +61 3 9639 9677
Fax: +61 3 9639 9577
--
IMPORTANT: This e-mail message and any attachments are confidential  
and may be privileged. If received in error, please reply to this  
message and destroy all copies and any attachments. You should check  
this message and any attachments for viruses or defects. Our  
liability is limited to 

Re: Help with NPE in EOCustomObject.willReadRelationship()

2009-04-28 Thread Peter Vandoros

Hi Chuck,

Thanks for responding Chuck :)

Just to be clear, I don't touch the deleted objects in this  
notification, I simply had debugging enabled and started getting  
errors :)


On 29/04/2009, at 2:40 PM, Chuck Hill wrote:


- The NPE occurs in a debug statement that prints the  
NSNotification object passed to my  
MyClass.editingContextDidSaveChanges() method before any processing  
occurs.


That is not going to have happy results...


What I don't understand is why the deleted objects are part of the  
notification if they're not meant to be used at all?


Obviously deleted EO's shouldn't have editingContext()'s, but I  
believe that EOCustomObject.eoDescription() should not fire _any_  
faults


I don't think that I would agree with that.  The information from  
firing faults can be very useful.  You can certainly re-implement it  
to not fire the faults or output something very limited if  
editingContext() == null.  That is a reasonable suggestion to make  
in a bug report.


I should clarify:

EOCustomObject.eoDescription() should not fire _any_ faults _when_ the  
EO is in an invalid state (eg. editingContext() == null)


.. and yes, I agree with you that output much more limited should be  
used instead.


or EOCustomObject.willReadRelationship() should check to see if  
editingContext() is null when 'object' is a fault.


And throw an exception.  That is a reasonable suggestion to make in  
a bug report.


Technically, it is throwing an exception now :) ... so the only  
reasonable exception to throw should again a NPE but with a reason as  
to the cause


That would make me nervous.  If this method is called when  
editingContext() == null, that indicates to me a coding mistake.  An  
exception seems appropriate and the NPE is not exactly helpful.


I agree with you that it is a mistake when called and editingContext()  
== null, but in my case, I am simply printing the NSNotification  
object for debugging... that surely shouldn't cause a NPE?


Regards

Peter Vandoros
Software Engineer
Etech Group Pty Ltd
Level 3/21 Victoria St
Melbourne VIC 3000
Australia

Ph: +61 3 9639 9677
Fax: +61 3 9639 9577
--
IMPORTANT: This e-mail message and any attachments are confidential  
and may be privileged. If received in error, please reply to this  
message and destroy all copies and any attachments. You should check  
this message and any attachments for viruses or defects. Our liability  
is limited to resupplying any affected message or attachments. For  
more information about Etech Group, please visit us at http://www.etechgroup.com.au 
.





___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: EOF issues

2009-04-28 Thread M.Y. Tjoe
separate set of object hierarchies seems feasible in our case as there  
is lot of dependency on existing framework. Thanks.


Regards,
Harvey


On 29/04/2009, at 12:41 PM, Ken Anderson wrote:


Harvey,

There are many discussions about this in the history, but the basic
idea is this - EOF doesn't like changing attributes that determine the
class/entity of an object.  The general consensus from the last time
this came up is, change how you do things so you don't have to do  
this.


How much behavior is actually different here?  Do you really need sub-
entities for this?  I remember a discussion at WWDC a number of years
ago where the iTunes team said that out of 400 entities, they only had
2 sets of object hierarchies.

One way I approach different behaviors when I don't want sub-entities
is to have a set of objects that do the special work you'd have a
subclass do, and have it determine which one to use dynamically.  For
instance, if the type is Student (right now) and you ask how many
classes it is taking, the helper class could make that determination
and return the result.  You can use key-value coding to make this
nearly transparent to the users of the Person object.

Ken

On Apr 28, 2009, at 10:31 PM, M.Y. Tjoe wrote:


Hi all,

I am currently investigating an interesting problem. Here is the
problem description:

A database table Person is represented in EOModel as Person with
3 childs  Staff , Student, External. There is type column in
Person to tell if he is staff/student/external.

The problem is that when a External object is fetched into a ec,
changed its type to student and saved changes,

i.e.

External external = External.fetchExternal(ec, External.ID_KEY,
'12345');
external.setType(student);
external.editingContext().saveChanges();

then in the same ec (or different ec) the now student still being
recognized as External somehow.

When you do

Student student = Student.fetchRequiredStudent(ec, Student.ID_KEY,
'12345');
or even
Person student = Person.fetchRequiredPerson(ec, Person.ID_KEY,
'12345');

An databaseContextFailedToFetchObject exception is thrown.

I am thinking the objects graph is now broken because Staff Object
supposed to be vanished from the graph but it didn't.

Any idea??

Regards,
Harvey

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com

This email sent to kenli...@anderhome.com




___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com