Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread Chuck Hill

On Apr 11, 2007, at 12:50 PM, David Avendasora wrote:

On Apr 11, 2007, at 2:03 PM, Chuck Hill wrote:

On Apr 11, 2007, at 12:01 PM, Ken Anderson wrote:


This is one of Jerry's reponses:

http://lists.apple.com/archives/webobjects-dev/2005/Jul/ 
msg00509.html




I am trying to wrap my mind around what Jerry has written here.  
It's going to take me a while, I think.


Yeah, it takes a while.


What Chuck is suggesting happening is that you have something on  
your page (like a WOConditional) that's state is bound to  
something that is changing.


Or you are altering the contents of an array that is bound to a  
WORepetion.  That would be my guess based on your description of  
this page.  Adding, removing, or moving the elements of an array  
while WO is in a repetition will have very, very odd effects from  
scrambled data to exceptions.


Chuck


I am altering two arrays that are bound to WORepetitions by moving  
an object from one to the other, but how is this different than if  
I had simply deleted/added an object from/to a relationship? Those  
functions alter the contents of arrays bound to WORepetitions as  
well and yet seem to work just fine.


There are two possibilities:

1. You were just lucky
2. You were altering the array _after_ the repetition had finished  
processing it


Think of a repetition as  a for loop.  WO runs through the loop once  
during appendToResponse when it first sends the page back to the  
browser.  It runs it a second time while is it in  
takeValuesFromRequest moving the form values into objects.  It runs  
though the loop a third time during the invokeAction phase.  If you  
alter what is in the arrays during this sequence, WO will mistake one  
object for another.  Think of the .HTML and .WOD as a programming  
language that WO interprets and _executes_ during each phase of the  
RR loop.  That is pretty close to what actually happens.  It is NOT  
static, it really does "execute" and WO calls methods in your Java  
class _while_ it is executing.


Chuck


When the form post comes back, WO tries to match up the structure  
of the page to get all the values out, and it effectively 'gets  
lost'.  What I usually do is have hyperlink or submit actions  
modify temporary variables that are not referenced during page  
creation.  Then, I override appendToResponse() in the component  
and update the real data from the temporary variables.  This way,  
you guarantee that your page structure is the same.


Ken

On Apr 11, 2007, at 2:47 PM, David Avendasora wrote:

Okay, I'm having a hard time finding the info by googling for  
it. Any chance of a link?


Thanks,

Dave

On Apr 11, 2007, at 11:16 AM, Ken Anderson wrote:

You can look for my prior postings too... I've even written up  
a decent solution a couple of times... :)


On Apr 11, 2007, at 12:07 PM, Chuck Hill wrote:

Paging Mr. Walker, Mr. Jerry Walker.  Mr. Jerry Walker, please  
come to the WO List.  :-)


This is one of Jerry's most favored rants.  I am pretty sure  
that what is happening is that you are modifying the structure  
of the page while it is processing the takeValues phase.   
Search for some of Jerry's past postings on this for the cause  
and solution.


Chuck







--

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve  
specific problems.

http://www.global-village.net/products/practical_webobjects












--

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village.net/products/practical_webobjects





___
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 archive@mail-archive.com


Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread David Avendasora


On Apr 11, 2007, at 2:03 PM, Chuck Hill wrote:



On Apr 11, 2007, at 12:01 PM, Ken Anderson wrote:


This is one of Jerry's reponses:

http://lists.apple.com/archives/webobjects-dev/2005/Jul/msg00509.html



I am trying to wrap my mind around what Jerry has written here. It's  
going to take me a while, I think.



You can go to lists.apple.com and pretty much search your heart out.

What Chuck is suggesting happening is that you have something on  
your page (like a WOConditional) that's state is bound to  
something that is changing.


Or you are altering the contents of an array that is bound to a  
WORepetion.  That would be my guess based on your description of  
this page.  Adding, removing, or moving the elements of an array  
while WO is in a repetition will have very, very odd effects from  
scrambled data to exceptions.


Chuck


I am altering two arrays that are bound to WORepetitions by moving an  
object from one to the other, but how is this different than if I had  
simply deleted/added an object from/to a relationship? Those  
functions alter the contents of arrays bound to WORepetitions as well  
and yet seem to work just fine.






When the form post comes back, WO tries to match up the structure  
of the page to get all the values out, and it effectively 'gets  
lost'.  What I usually do is have hyperlink or submit actions  
modify temporary variables that are not referenced during page  
creation.  Then, I override appendToResponse() in the component  
and update the real data from the temporary variables.  This way,  
you guarantee that your page structure is the same.


Ken

On Apr 11, 2007, at 2:47 PM, David Avendasora wrote:

Okay, I'm having a hard time finding the info by googling for it.  
Any chance of a link?


Thanks,

Dave

On Apr 11, 2007, at 11:16 AM, Ken Anderson wrote:

You can look for my prior postings too... I've even written up a  
decent solution a couple of times... :)


On Apr 11, 2007, at 12:07 PM, Chuck Hill wrote:

Paging Mr. Walker, Mr. Jerry Walker.  Mr. Jerry Walker, please  
come to the WO List.  :-)


This is one of Jerry's most favored rants.  I am pretty sure  
that what is happening is that you are modifying the structure  
of the page while it is processing the takeValues phase.   
Search for some of Jerry's past postings on this for the cause  
and solution.


Chuck







--

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village.net/products/practical_webobjects









___
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 archive@mail-archive.com


Re: No instance found alert ?

2007-04-11 Thread Zak Burke

Mike Schrag wrote on 4/11/07 2:39 PM:
That's a clever idea ... Does that CGI script fire in the case of a 
request timeout that causes a No instance available even if the user has 
dropped their connection before the request actually times out?


I think so, as I do get some seemingly spurious error messages from 
time to time, and those could easily be from request timeouts. I'll 
play with this a bit and see what I can learn. I haven't grepped 
through my logs to see if any messages correspond to timeout of 
known-slow pages, but that could be an interesting thing to look at.


I'll test a bit and post back to the list.

zak.




On Apr 11, 2007, at 2:28 PM, Zak Burke wrote:


James Cicenia wrote on 4/11/07 10:06 AM:

Anyone know of a good cheap service to monitor my web apps when they
stop responding... i.e, no instance available, etc.


My Adaptor Settings/Redirection URL is a CGI script that sends email 
(see below). You can also set up a cron-job to periodically hit your 
site and, e.g. create a socket connection on ports 80 and 443 to make 
sure httpd is up (further below), or point curl at your site to make 
you're not seeing "no instance available" in your responses (i.e. 
httpd is up, but your app is down).


For a one-time $36 fee www.freeshell.org will give you a unix shell 
account that, I believe, has cron access.


zak.

___
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 archive@mail-archive.com


Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread Chuck Hill


On Apr 11, 2007, at 12:01 PM, Ken Anderson wrote:


This is one of Jerry's reponses:

http://lists.apple.com/archives/webobjects-dev/2005/Jul/msg00509.html

You can go to lists.apple.com and pretty much search your heart out.

What Chuck is suggesting happening is that you have something on  
your page (like a WOConditional) that's state is bound to something  
that is changing.


Or you are altering the contents of an array that is bound to a  
WORepetion.  That would be my guess based on your description of this  
page.  Adding, removing, or moving the elements of an array while WO  
is in a repetition will have very, very odd effects from scrambled  
data to exceptions.


Chuck


When the form post comes back, WO tries to match up the structure  
of the page to get all the values out, and it effectively 'gets  
lost'.  What I usually do is have hyperlink or submit actions  
modify temporary variables that are not referenced during page  
creation.  Then, I override appendToResponse() in the component and  
update the real data from the temporary variables.  This way, you  
guarantee that your page structure is the same.


Ken

On Apr 11, 2007, at 2:47 PM, David Avendasora wrote:

Okay, I'm having a hard time finding the info by googling for it.  
Any chance of a link?


Thanks,

Dave

On Apr 11, 2007, at 11:16 AM, Ken Anderson wrote:

You can look for my prior postings too... I've even written up a  
decent solution a couple of times... :)


On Apr 11, 2007, at 12:07 PM, Chuck Hill wrote:

Paging Mr. Walker, Mr. Jerry Walker.  Mr. Jerry Walker, please  
come to the WO List.  :-)


This is one of Jerry's most favored rants.  I am pretty sure  
that what is happening is that you are modifying the structure  
of the page while it is processing the takeValues phase.  Search  
for some of Jerry's past postings on this for the cause and  
solution.


Chuck







--

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village.net/products/practical_webobjects





___
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 archive@mail-archive.com


Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread Ken Anderson

This is one of Jerry's reponses:

http://lists.apple.com/archives/webobjects-dev/2005/Jul/msg00509.html

You can go to lists.apple.com and pretty much search your heart out.

What Chuck is suggesting happening is that you have something on your  
page (like a WOConditional) that's state is bound to something that  
is changing.  When the form post comes back, WO tries to match up the  
structure of the page to get all the values out, and it effectively  
'gets lost'.  What I usually do is have hyperlink or submit actions  
modify temporary variables that are not referenced during page  
creation.  Then, I override appendToResponse() in the component and  
update the real data from the temporary variables.  This way, you  
guarantee that your page structure is the same.


Ken

On Apr 11, 2007, at 2:47 PM, David Avendasora wrote:

Okay, I'm having a hard time finding the info by googling for it.  
Any chance of a link?


Thanks,

Dave

On Apr 11, 2007, at 11:16 AM, Ken Anderson wrote:

You can look for my prior postings too... I've even written up a  
decent solution a couple of times... :)


On Apr 11, 2007, at 12:07 PM, Chuck Hill wrote:

Paging Mr. Walker, Mr. Jerry Walker.  Mr. Jerry Walker, please  
come to the WO List.  :-)


This is one of Jerry's most favored rants.  I am pretty sure that  
what is happening is that you are modifying the structure of the  
page while it is processing the takeValues phase.  Search for  
some of Jerry's past postings on this for the cause and solution.


Chuck




___
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 archive@mail-archive.com


two wotaskd on a single machine... [was: Any docs]

2007-04-11 Thread Mark Ritchie

On 11-Apr-07, at 2:34 PM, Gino Pacitti wrote:
Are there any docs on running two wotaskd on a single machine each  
serving a different ethernet port and IP address?


This should get you started:
"Deploying Multiple Sites" on a single machine:
http://developer.apple.com/documentation/WebObjects/Deployment/ 
Deploying_Applications/Deployment/chapter_6_section_8.html


Further deployment questions should probably go to
webobjects-deploy@lists.apple.com

Good luck!
Mark
__
Mark Ritchie
Cocoa and WebObjects Developer
Diamond Lake Consulting Inc.
Toronto, Ontario, Canada



 ___
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 archive@mail-archive.com

Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread David Avendasora
Okay, I'm having a hard time finding the info by googling for it. Any  
chance of a link?


Thanks,

Dave

On Apr 11, 2007, at 11:16 AM, Ken Anderson wrote:

You can look for my prior postings too... I've even written up a  
decent solution a couple of times... :)


On Apr 11, 2007, at 12:07 PM, Chuck Hill wrote:

Paging Mr. Walker, Mr. Jerry Walker.  Mr. Jerry Walker, please  
come to the WO List.  :-)


This is one of Jerry's most favored rants.  I am pretty sure that  
what is happening is that you are modifying the structure of the  
page while it is processing the takeValues phase.  Search for some  
of Jerry's past postings on this for the cause and solution.


Chuck


___
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 archive@mail-archive.com


Re: No instance found alert ?

2007-04-11 Thread Mike Schrag
That's a clever idea ... Does that CGI script fire in the case of a  
request timeout that causes a No instance available even if the user  
has dropped their connection before the request actually times out?


ms

On Apr 11, 2007, at 2:28 PM, Zak Burke wrote:


James Cicenia wrote on 4/11/07 10:06 AM:

Anyone know of a good cheap service to monitor my web apps when they
stop responding... i.e, no instance available, etc.


My Adaptor Settings/Redirection URL is a CGI script that sends  
email (see below). You can also set up a cron-job to periodically  
hit your site and, e.g. create a socket connection on ports 80 and  
443 to make sure httpd is up (further below), or point curl at your  
site to make you're not seeing "no instance available" in your  
responses (i.e. httpd is up, but your app is down).


For a one-time $36 fee www.freeshell.org will give you a unix shell  
account that, I believe, has cron access.


zak.




#!/usr/bin/perl -w

# --
# -- KB error page, displayed by WO when our application is  
unavailable,
# -- sends email to the webmaster if $ENV{DOCUMENT_ROOT}/ 
i3pkb_error is

# -- more than 10 minutes old.
# --
# -- 2005-10-25, [EMAIL PROTECTED]
# --

use strict;



# recipient of email sent by this script
use constant RECIPIENT => "[EMAIL PROTECTED]";

# sender of email sent by this script
use constant SENDER=> "[EMAIL PROTECTED]";

# gateway to send mail through
use constant MAILHOST  => "mail.thei3p.org";

# full path to error file
# must be owned by the webserver user and chmod 700
use constant ERROR_FILE => "$ENV{'DOCUMENT_ROOT'}/i3pkb_error";

# --
# -- nothing to configure below
# --





BEGIN
{
use strict;
use CGI;
use Email::Send;
use File::stat;
}


main();

sub main
{

my ($cgi, $message, $content, $submitter, @list) = undef;

# send mail if it's been 10 minutes since the last time
# this error was recorded
my $stat = lstat(ERROR_FILE);

if ($stat && (time() - $stat->mtime) > 600) {

$message .= "The application i3pkb on $ENV{'SERVER_NAME'}  
is not responding and must be restarted." ;


# message to registrar
send_mail($message, (time() - $stat->mtime), RECIPIENT,  
SENDER);


}

# reset the error timestamp
my $error_file = ERROR_FILE;
`touch $error_file`;


# display error page in browser
$cgi = CGI->new();
print $cgi->header();
print template();

}



#
# send_mail
# send a message
sub send_mail
{
my ($message, $age, $recipient, $sender) = @_;

my $error_file = ERROR_FILE;

send SMTP => <<"EOT", MAILHOST;
To: $recipient
From: $sender
Subject: ERROR: i3pkb on $ENV{'SERVER_NAME'} MUST BE RESTARTED

$message

$error_file was $age seconds old.


EOT

}



# --

# --
# -- template
# -- return the WO error page to display in place of the
# -- requested page.
sub template
{
open FILE, "$ENV{'DOCUMENT_ROOT'}/index.html";
my @lines = ;
close FILE;

return join "\n", @lines;
}





#!/usr/bin/perl -w

#
# dead simple server monitoring script
# checks whether a TCP socket can be created on a given server:port
# sends mail when a socket connection fails
#
# [EMAIL PROTECTED], 2007-02-28
#
#


use strict;
use IO::Socket;
use Email::Send;

use constant MAIL_SENDER=> "[EMAIL PROTECTED]";
use constant MAIL_RECIPIENT => ("[EMAIL PROTECTED]");
use constant SMTP_SERVER=> "mail.thei3p.org";


#
# hosts
# returns a [EMAIL PROTECTED] of hosts and their services to monitor
sub hosts
{
my @list;

# http, https, imaps, smtp
push @list, new_host("some.host.org", "80");
push @list, new_host("some.host.org", "443");
push @list, new_host("some.host.org", "993");
push @list, new_host("some.host.org", "25");


return [EMAIL PROTECTED];
}


#
# NOTHING TO CONFIGURE BELOW
#



main();

sub main
{
my ($socket, $status);
for my $host (@{ hosts() }) {

print "testing $host->{host}:$host->{port}...\n";

$socket = IO::Socket::INET->new(
PeerAddr => $host->{host},
PeerPort => $host->{port},
Proto=> 'tcp',
Type => SOCK_STREAM,
Timeout  => 3,
);

if (! $socket) {
print STDERR "$host->{host}:$host->{port} is  
unreachable.\n";
message_send("$host->{host}:$host->{port} is  
unreachable.");

}

}

}



# --

#
# new_host
# shortcut to create a new hashref of server-name, server-ip and  
server-port

sub new_host
{
my ($host, $port) = @_;

return {"host" => $host, "port" => $port};
}



# --

#
# message_send
# send a warning email
sub message_send
{
my ($subject) = @_;

for my $recip (MAIL_RECIPIENT)
{
my $sender= MAIL_SENDER;
send SMTP => <<"EOT", SMTP_SERVER;
To: $recip
From: $sender
Subject: $subject

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

Any docs

2007-04-11 Thread Gino Pacitti

Hi All

Are there any docs on running two wotaskd on a single machine each  
serving a different ethernet port and IP address?


Gino
___
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 archive@mail-archive.com


Re: No instance found alert ?

2007-04-11 Thread Zak Burke

James Cicenia wrote on 4/11/07 10:06 AM:

Anyone know of a good cheap service to monitor my web apps when they
stop responding... i.e, no instance available, etc.


My Adaptor Settings/Redirection URL is a CGI script that sends email 
(see below). You can also set up a cron-job to periodically hit your 
site and, e.g. create a socket connection on ports 80 and 443 to 
make sure httpd is up (further below), or point curl at your site to 
make you're not seeing "no instance available" in your responses 
(i.e. httpd is up, but your app is down).


For a one-time $36 fee www.freeshell.org will give you a unix shell 
account that, I believe, has cron access.


zak.




#!/usr/bin/perl -w

# --
# -- KB error page, displayed by WO when our application is 
unavailable,

# -- sends email to the webmaster if $ENV{DOCUMENT_ROOT}/i3pkb_error is
# -- more than 10 minutes old.
# --
# -- 2005-10-25, [EMAIL PROTECTED]
# --

use strict;



# recipient of email sent by this script
use constant RECIPIENT => "[EMAIL PROTECTED]";

# sender of email sent by this script
use constant SENDER=> "[EMAIL PROTECTED]";

# gateway to send mail through
use constant MAILHOST  => "mail.thei3p.org";

# full path to error file
# must be owned by the webserver user and chmod 700
use constant ERROR_FILE => "$ENV{'DOCUMENT_ROOT'}/i3pkb_error";

# --
# -- nothing to configure below
# --





BEGIN
{
use strict;
use CGI;
use Email::Send;
use File::stat;
}


main();

sub main
{

my ($cgi, $message, $content, $submitter, @list) = undef;

# send mail if it's been 10 minutes since the last time
# this error was recorded
my $stat = lstat(ERROR_FILE);

if ($stat && (time() - $stat->mtime) > 600) {

$message .= "The application i3pkb on $ENV{'SERVER_NAME'} 
is not responding and must be restarted." ;


# message to registrar
send_mail($message, (time() - $stat->mtime), RECIPIENT, 
SENDER);


}

# reset the error timestamp
my $error_file = ERROR_FILE;
`touch $error_file`;


# display error page in browser
$cgi = CGI->new();
print $cgi->header();
print template();

}



#
# send_mail
# send a message
sub send_mail
{
my ($message, $age, $recipient, $sender) = @_;

my $error_file = ERROR_FILE;

send SMTP => <<"EOT", MAILHOST;
To: $recipient
From: $sender
Subject: ERROR: i3pkb on $ENV{'SERVER_NAME'} MUST BE RESTARTED

$message

$error_file was $age seconds old.


EOT

}



# --

# --
# -- template
# -- return the WO error page to display in place of the
# -- requested page.
sub template
{
open FILE, "$ENV{'DOCUMENT_ROOT'}/index.html";
my @lines = ;
close FILE;

return join "\n", @lines;
}





#!/usr/bin/perl -w

#
# dead simple server monitoring script
# checks whether a TCP socket can be created on a given server:port
# sends mail when a socket connection fails
#
# [EMAIL PROTECTED], 2007-02-28
#
#


use strict;
use IO::Socket;
use Email::Send;

use constant MAIL_SENDER=> "[EMAIL PROTECTED]";
use constant MAIL_RECIPIENT => ("[EMAIL PROTECTED]");
use constant SMTP_SERVER=> "mail.thei3p.org";


#
# hosts
# returns a [EMAIL PROTECTED] of hosts and their services to monitor
sub hosts
{
my @list;

# http, https, imaps, smtp
push @list, new_host("some.host.org", "80");
push @list, new_host("some.host.org", "443");
push @list, new_host("some.host.org", "993");
push @list, new_host("some.host.org", "25");


return [EMAIL PROTECTED];
}


#
# NOTHING TO CONFIGURE BELOW
#



main();

sub main
{
my ($socket, $status);
for my $host (@{ hosts() }) {

print "testing $host->{host}:$host->{port}...\n";

$socket = IO::Socket::INET->new(
PeerAddr => $host->{host},
PeerPort => $host->{port},
Proto=> 'tcp',
Type => SOCK_STREAM,
Timeout  => 3,
);

if (! $socket) {
print STDERR "$host->{host}:$host->{port} is 
unreachable.\n";
message_send("$host->{host}:$host->{port} is 
unreachable.");

}

}

}



# --

#
# new_host
# shortcut to create a new hashref of server-name, server-ip and 
server-port

sub new_host
{
my ($host, $port) = @_;

return {"host" => $host, "port" => $port};
}



# --

#
# message_send
# send a warning email
sub message_send
{
my ($subject) = @_;

for my $recip (MAIL_RECIPIENT)
{
my $sender= MAIL_SENDER;
send SMTP => <<"EOT", SMTP_SERVER;
To: $recip
From: $sender
Subject: $subject

$subject
EOT
}
}
___
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 archive@mail-archive.com


Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread David Avendasora


On Apr 11, 2007, at 6:36 AM, Ken Anderson wrote:


David,

Are you sure you're looking at the same RSComponent when you find  
all the relationships null?  To me, that is a clear case of  
RSComponent being the target of a mandatory to-one relationship.   
Under certain circumstances, EOF will create an empty EO that's the  
target of that mandatory to-one.


Ken



I'm sure it's not a new, empty instance of the rsComponent..

#1) the rsComponents() relationship is not maditory in the EOModel,  
and it is to-many from RoutingStep (RoutingStep<-->>rsComponent).
#2) I have logging (thanks to EOGenerator) on all my setters, and it  
shows what the previous value was and what the new value is. It is  
taking an object with values, and nullifying them.


Here's an example from the Run Log. See comments within:

Here it sets the routingStep relationship properly (see bottom of  
email for the setRoutingStepRelationship() code).


2007-04-11 07:45:27,282 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setRoutin 
gStepRelationship - updating routingStep from {values =  
{routingStepSequence = 4; instructions = "Fast Blend Oats 10-15- 
SECONDS"; workCenter =  
"_EOIntegralKeyGlobalID[WorkCenter (java.lang.Long)1]>"; routing =  
"_EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1758]>";  
billOfMaterialComponents =  
("583f4c _EOIntegralKeyGlobalID[BillOfMaterialComponent (java.lang.Long) 
8495]>"); routingStepName = "Fast Blend Oats"; toolConfigurations =  
"([RoutingStep (java.lang.Long)7164]>)>"; }; this =  
"_EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7164]>"; } to  
{values = {routingStepSequence = 5; instructions = "Test"; workCenter  
= "_EOIntegralKeyGlobalID[WorkCenter (java.lang.Long)1]>"; routing =  
"_EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1758]>";  
billOfMaterialComponents = (); routingStepName = "Test";  
toolConfigurations =  
"([RoutingStep (java.lang.Long)7167]>)>"; }; this =  
"_EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7167]>"; }


Immediately followed by other misc updates:

2007-04-11 07:45:27,287 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setLineNu 
mber - updating lineNumber from 17 to 17
2007-04-11 07:45:27,354 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setScrapP 
ercent - updating scrapPercent from 0.00 to 0.


Here it begins setting all attributes of the same rsComponent (aka  
BillOfMaterialComponent) to null! you can see by the time stamp that  
it is doing it immediately after the proper update. Also, I can tell  
by the attributes (part.partDescription, etc) that it is, in fact,  
the rsComponent that I requested be updated that is now being nullified.


2007-04-11 07:45:27,356 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setRoutin 
gStepRelationship - updating routingStep from {values =  
{routingStepSequence = 5; instructions = "Test"; workCenter =  
"_EOIntegralKeyGlobalID[WorkCenter (java.lang.Long)1]>"; routing =  
"_EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1758]>";  
billOfMaterialComponents =  
("583f4c _EOIntegralKeyGlobalID[BillOfMaterialComponent (java.lang.Long) 
8495]>"); routingStepName = "Test"; toolConfigurations =  
"([RoutingStep (java.lang.Long)7167]>)>"; }; this =  
"_EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7167]>"; } to null


[2007-04-11 07:45:27 COT]  Validation failed on an  
object [null] with keypath =  
aRequestedBillOfMaterialBillOfMaterialComponent.lineNumber and  
exception: The lineNumber property of BillOfMaterialComponent is not  
allowed to be null.


2007-04-11 07:45:27,371 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setPartRe 
lationship - updating part from {values = {rawType =  
"(com.webobjects.eoaccess.EOAccessFaultHandler _EOIntegralKeyGlobalID 
[RawType (java.lang.Long)7])>"; unitOfMeasure =  
"_EOIntegralKeyGlobalID[UnitOfMeasure (java.lang.Long)1]>"; lotCodes =  
"((java.lang.Long)424]>)>"; componentOfBillsOfMaterial =  
"(_EOIntegralKeyGlobalID[Raw (java.lang.Long)424]>)>"; statementBlocks  
= "([Raw (java.lang.Long)424]>)>"; partDescription = "Oats, Quick , Oats,  
Quick"; nutritionBlocks =  
"([Raw (java.lang.Long)424]>)>"; partNumber = "020741";  
partType = "(com.webobjects.eoaccess.EOAccessFaultHandler _EOIntegralKeyGlobalID 
[PartType (java.lang.Long)2])>"; partName = "Oats, Quick ";  
workCentersUsedIn =  
"([Raw (java.lang.Long)424]>)>"; }; this =  
"[Raw (java.lang.Long)424]>"; } to null


[2007-04-11 07:45:27 COT]  Validation failed on an  
object [null] with keypath =  
aRequestedBillOfMaterialBillOfMaterialComponent.scrapFixed and  
exception: The scrapFixed property of BillOfMaterialComponent is not  
allowed to be null.


2007-04-11 07:45:27,404 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setUnitOf 
MeasureRelationship - updating unitOfMeasure from {values =  
{uomAbbreviation = "lb"; uomNamePlural =

Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread Ken Anderson
You can look for my prior postings too... I've even written up a  
decent solution a couple of times... :)


On Apr 11, 2007, at 12:07 PM, Chuck Hill wrote:

Paging Mr. Walker, Mr. Jerry Walker.  Mr. Jerry Walker, please come  
to the WO List.  :-)


This is one of Jerry's most favored rants.  I am pretty sure that  
what is happening is that you are modifying the structure of the  
page while it is processing the takeValues phase.  Search for some  
of Jerry's past postings on this for the cause and solution.


Chuck


On Apr 10, 2007, at 8:42 PM, David Avendasora wrote:


Okay, I spoke too soon.

It works to change SOME relationships, but not others. Here's what  
it does:


For example, if I change the relationship of a RSComponent from  
RoutingStep 4 to RoutingStep 3, it works as expected, simply  
changing both sides of the RoutingStep<-->>RSComponent  
relationship. BUT, if I then change the same RSComponent  
relationship back from RoutingStep 3 to RoutingStep 4, it also  
updates the relationship as expected, and then it continues on to  
set all the attributes and relationships of the RSComponent to null!


What is causing it to do this extra step of nullifying everything?!

I have also seen it "hijack" the values of an existing RSComponent  
in the target RoutingStep, then nullify all attributes of the  
RSComponent that it hijacked. This effectively makes it look like  
the RSComponent that I was moving from one RoutingStep to another  
disappears, but in fact it's there, just having been updated to  
look exactly like an existing RSComponent.


Very strange.

Dave

On Apr 10, 2007, at 1:29 PM, David Avendasora wrote:


Thanks Ken!

Once I read your message it seems SO obvious. I had to modify my  
EOGenerator template to add the new getter method, but once I did  
that and changed the binding, it works perfectly!


Dave


On Apr 10, 2007, at 1:08 PM, Ken Anderson wrote:


David,

Since you're changing a relationship and you want it to be  
reflected in the model immediately, you'll have to handle the  
action yourself and update the model using  
addObjectToBothSidesOfRelationshipWityKey or  
removeObjectFromBothSidesOfRelationshipWithKey.  If you're  
generating your classes with EOGenerator, you probably have  
methods that do this for you already.


The issue is, the pop up button just changes the value with key  
value coding, without affecting the opposite side of the  
relationship.


What I usually do in these circumstances is add 2 new methods to  
the EO - to replace the KVC normally used.  Something like:


- (RoutingStep) routingStepRelationship {
return this.routingStep();
}

- (void) setRoutingStepRelationship:(RoutingStep) step {
	this.addObjectToBothSidesOfRelationshipWithKey(step,  
"routingStep");

}

Again, these can be auto-generated for you by EOGenerator.  If  
you then change the 'selection' binding of the pop-up from  
'routingStep' to 'routingStepRelationship', KVC will call your  
set method, which will directly manipulate the object graph.


Ken

On Apr 10, 2007, at 1:35 PM, David Avendasora wrote:


I'm going to try to clarify  this a bit:

Here's the structure of my Form, the important part is in bold:


aRouting

















Here's the code for the action of the WOSubmitButton:

public WOComponent applyChangesToRouting() {
return context().page();
}

The critical portion is the relationship of RoutingStep<-- 
>>RSComponent


When I select a different RoutingStep for a RSComponent using  
the WOPopUpButton and click the WOSubmitButton, it does update,  
but when the page comes back, the aRSComponent that I changed  
shows that it is now related to the new RoutingStep, but it is  
actually physically drawn on the page as still being in the  
original RoutingStep.


If I save the changes to the DB, and dump the session and re- 
enter the app, the RSComponent will be in the right location.  
So it seems to me that everything is actually being updated  
correctly, BUT the data being used to draw the page immediately  
after the update is _partially_ old. The original  
routingStep.rcComponents() array still has the old RCComponent  
in it and the new routingStep.rcComponents() array does not yet  
have the RCComponent in it that it should. BUT the  
rcComponent.routingStep() relationship DOES have the correct  
RoutingStep in it.


If I don't save it to the database and then come back in with a  
new session, then I only see half of the updated relationship.


How do I get the RoutingStep.rsComponents() relationship  
updates to show up?


Dave


On Apr 10, 2007, at 7:52 AM, David Avendasora wrote:

Okay, I over-simplified the problem some. On the actual  
component, I'm not saving the changes to the database until  
the user clicks the "

Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread Chuck Hill
Paging Mr. Walker, Mr. Jerry Walker.  Mr. Jerry Walker, please come  
to the WO List.  :-)


This is one of Jerry's most favored rants.  I am pretty sure that  
what is happening is that you are modifying the structure of the page  
while it is processing the takeValues phase.  Search for some of  
Jerry's past postings on this for the cause and solution.


Chuck


On Apr 10, 2007, at 8:42 PM, David Avendasora wrote:


Okay, I spoke too soon.

It works to change SOME relationships, but not others. Here's what  
it does:


For example, if I change the relationship of a RSComponent from  
RoutingStep 4 to RoutingStep 3, it works as expected, simply  
changing both sides of the RoutingStep<-->>RSComponent  
relationship. BUT, if I then change the same RSComponent  
relationship back from RoutingStep 3 to RoutingStep 4, it also  
updates the relationship as expected, and then it continues on to  
set all the attributes and relationships of the RSComponent to null!


What is causing it to do this extra step of nullifying everything?!

I have also seen it "hijack" the values of an existing RSComponent  
in the target RoutingStep, then nullify all attributes of the  
RSComponent that it hijacked. This effectively makes it look like  
the RSComponent that I was moving from one RoutingStep to another  
disappears, but in fact it's there, just having been updated to  
look exactly like an existing RSComponent.


Very strange.

Dave

On Apr 10, 2007, at 1:29 PM, David Avendasora wrote:


Thanks Ken!

Once I read your message it seems SO obvious. I had to modify my  
EOGenerator template to add the new getter method, but once I did  
that and changed the binding, it works perfectly!


Dave


On Apr 10, 2007, at 1:08 PM, Ken Anderson wrote:


David,

Since you're changing a relationship and you want it to be  
reflected in the model immediately, you'll have to handle the  
action yourself and update the model using  
addObjectToBothSidesOfRelationshipWityKey or  
removeObjectFromBothSidesOfRelationshipWithKey.  If you're  
generating your classes with EOGenerator, you probably have  
methods that do this for you already.


The issue is, the pop up button just changes the value with key  
value coding, without affecting the opposite side of the  
relationship.


What I usually do in these circumstances is add 2 new methods to  
the EO - to replace the KVC normally used.  Something like:


- (RoutingStep) routingStepRelationship {
return this.routingStep();
}

- (void) setRoutingStepRelationship:(RoutingStep) step {
	this.addObjectToBothSidesOfRelationshipWithKey(step,  
"routingStep");

}

Again, these can be auto-generated for you by EOGenerator.  If  
you then change the 'selection' binding of the pop-up from  
'routingStep' to 'routingStepRelationship', KVC will call your  
set method, which will directly manipulate the object graph.


Ken

On Apr 10, 2007, at 1:35 PM, David Avendasora wrote:


I'm going to try to clarify  this a bit:

Here's the structure of my Form, the important part is in bold:


aRouting

















Here's the code for the action of the WOSubmitButton:

public WOComponent applyChangesToRouting() {
return context().page();
}

The critical portion is the relationship of RoutingStep<-- 
>>RSComponent


When I select a different RoutingStep for a RSComponent using  
the WOPopUpButton and click the WOSubmitButton, it does update,  
but when the page comes back, the aRSComponent that I changed  
shows that it is now related to the new RoutingStep, but it is  
actually physically drawn on the page as still being in the  
original RoutingStep.


If I save the changes to the DB, and dump the session and re- 
enter the app, the RSComponent will be in the right location. So  
it seems to me that everything is actually being updated  
correctly, BUT the data being used to draw the page immediately  
after the update is _partially_ old. The original  
routingStep.rcComponents() array still has the old RCComponent  
in it and the new routingStep.rcComponents() array does not yet  
have the RCComponent in it that it should. BUT the  
rcComponent.routingStep() relationship DOES have the correct  
RoutingStep in it.


If I don't save it to the database and then come back in with a  
new session, then I only see half of the updated relationship.


How do I get the RoutingStep.rsComponents() relationship updates  
to show up?


Dave


On Apr 10, 2007, at 7:52 AM, David Avendasora wrote:

Okay, I over-simplified the problem some. On the actual  
component, I'm not saving the changes to the database until the  
user clicks the "save" button. They _could_ save the changes  
after every change, but I want them to be able to revert, undo,  
and redo.


I don't really understand how I ca

Re: Object Store

2007-04-11 Thread David LeBer


On 11-Apr-07, at 11:21 AM, Frank Stock wrote:


Hi Mike,

I just installed WOWonder into my project.

How can I set the Object Store now? Can I find an example of that,

Do I just put  
er.extensions.ERXObjectStoreCoordinatorPool.maxCoordinators=5 in  
the Application class.


I don't use sessions so now I set EOEditingContext ec= new  
EOEditongContext().


Thanks for the help!


Read through the wikibook. I'd suggest the Quickstart page first.



I recommend ProjectWonder whole heartedly, but it is huge, and not  
really something I'd jump into on a whim.


Be prepared to spend some serious quality time with it.

--
;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://www.codeferous.com
blog: http://david.codeferous.com
profile: http://www.linkedin.com/in/davidleber
--
Toronto Area Cocoa / WebObjects developers group:
http://www.tacow.org




smime.p7s
Description: S/MIME cryptographic signature
 ___
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 archive@mail-archive.com

Re: Object Store

2007-04-11 Thread Guido Neitzer

On 11.04.2007, at 09:21, Frank Stock wrote:

Do I just put  
er.extensions.ERXObjectStoreCoordinatorPool.maxCoordinators=5 in  
the Application class.


I don't use sessions so now I set EOEditingContext ec= new  
EOEditongContext().


If you really want to use Wonder, do the following:

1. Let your Application class inherit from ERXApplication.
1b. Call ERXApplication.main instead of WOApplication.main in  
Application


2. Let your Session class inherit from ERXSession.

3. Use "ERXEC editingContext = (ERXEC) ERXEC.newEditingContext();"  
instead of "EOEditingContext ec = new EditingContext();"


4. Read all the entries in Properties in ERXExtension and decide  
whether or not you want to use a specific feature.


cug
___
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 archive@mail-archive.com


Object Store

2007-04-11 Thread Frank Stock

Hi Mike,

I just installed WOWonder into my project.

How can I set the Object Store now? Can I find an example of that,

Do I just put  
er.extensions.ERXObjectStoreCoordinatorPool.maxCoordinators=5 in the  
Application class.


I don't use sessions so now I set EOEditingContext ec= new  
EOEditongContext().


Thanks for the help!

Frank Stock
___
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 archive@mail-archive.com


Re: Object Store

2007-04-11 Thread Mike Schrag
Yep -- @see ERXObjectStoreCoordinatorPool and  
ERXObjectStoreCoordinatorSynchronizer for more info.  This is also  
the same backend that ERXRemoteSynchronizer hooks into to do multicast 
(/whatever) remote change notification.


ms

On Apr 11, 2007, at 10:17 AM, David LeBer wrote:


On 11-Apr-07, at 10:05 AM, Mike Schrag wrote:

You have to be sort of careful, because making new EOF stacks  
means you have to deal w/ cache freshness issues.  If you're using  
Wonder, this is not really an issue -- you can just turn on:


er.extensions.ERXObjectStoreCoordinatorPool.maxCoordinators=5

and it will keep the stores in sync.


Holy Carp! Really? I did not know that... That is frikken cool.

The other thing to consider is that for each object store, you get  
a new snapshot cache, which means cache memory usage is going to  
be 5x more (if coordinators = 5).


--
;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://www.codeferous.com
blog: http://david.codeferous.com
profile: http://www.linkedin.com/in/davidleber
--
Toronto Area Cocoa / WebObjects developers group:
http://www.tacow.org





___
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 archive@mail-archive.com


Re: Object Store

2007-04-11 Thread Mark Ritchie

On 11-Apr-07, at 9:53 AM, Frank Stock wrote:
I did some stress-testing and one of the calls goes from 1 second  
to 22 seconds under heavy load.


Wow, why such a change in timing?  Sounds like you need to profile  
this application with Shark and see what's going on!  I'd make a  
recording of a test case with -WORecordingPath and then use the  
playback tool to run that case while monitoring the application with  
Shark (Don't forget the -XrunShark argument!)  Then repeat this cycle  
until the application is running acceptably: profile, analyze, modify  
code, repeat!


Good Luck!
Mark
__
Mark Ritchie
Cocoa and WebObjects Developer
Diamond Lake Consulting Inc.
Toronto, Ontario, Canada



 ___
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 archive@mail-archive.com

Re: Object Store

2007-04-11 Thread David LeBer

On 11-Apr-07, at 10:05 AM, Mike Schrag wrote:

You have to be sort of careful, because making new EOF stacks means  
you have to deal w/ cache freshness issues.  If you're using  
Wonder, this is not really an issue -- you can just turn on:


er.extensions.ERXObjectStoreCoordinatorPool.maxCoordinators=5

and it will keep the stores in sync.


Holy Carp! Really? I did not know that... That is frikken cool.

The other thing to consider is that for each object store, you get  
a new snapshot cache, which means cache memory usage is going to be  
5x more (if coordinators = 5).


--
;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://www.codeferous.com
blog: http://david.codeferous.com
profile: http://www.linkedin.com/in/davidleber
--
Toronto Area Cocoa / WebObjects developers group:
http://www.tacow.org




smime.p7s
Description: S/MIME cryptographic signature
 ___
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 archive@mail-archive.com

No instance found alert ?

2007-04-11 Thread James Cicenia

Hello -

Anyone know of a good cheap service to monitor my web apps when they
stop responding... i.e, no instance available, etc.

Thanks
James Cicenia

___
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 archive@mail-archive.com


Re: Object Store

2007-04-11 Thread Mike Schrag
You have to be sort of careful, because making new EOF stacks means  
you have to deal w/ cache freshness issues.  If you're using Wonder,  
this is not really an issue -- you can just turn on:


er.extensions.ERXObjectStoreCoordinatorPool.maxCoordinators=5

and it will keep the stores in sync.  The other thing to consider is  
that for each object store, you get a new snapshot cache, which means  
cache memory usage is going to be 5x more (if coordinators = 5).


ms

On Apr 11, 2007, at 9:53 AM, Frank Stock wrote:

We have an application with a lot of SOAP-CALLS. It seems that our  
Object Store is becoming a bottle-neck (MySQL). I did some stress- 
testing and one of the calls goes from 1 second to 22 seconds under  
heavy load. I did a test with a new Objects Store, just for that  
call and it goes to 2 seconds. How can I make more (30?) object  
stores that I can use in my SOAP-CALLS to speed up my application?  
Sometimes the speed is unacceptable for our clients.



Thanks,
Frank Stock
___
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 [EMAIL PROTECTED]



___
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 archive@mail-archive.com


Object Store

2007-04-11 Thread Frank Stock
We have an application with a lot of SOAP-CALLS. It seems that our  
Object Store is becoming a bottle-neck (MySQL). I did some stress- 
testing and one of the calls goes from 1 second to 22 seconds under  
heavy load. I did a test with a new Objects Store, just for that call  
and it goes to 2 seconds. How can I make more (30?) object stores  
that I can use in my SOAP-CALLS to speed up my application? Sometimes  
the speed is unacceptable for our clients.



Thanks,
Frank Stock
___
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 archive@mail-archive.com


Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread David Avendasora

(truncated old messages to get past filter)

On Apr 11, 2007, at 6:36 AM, Ken Anderson wrote:


David,

Are you sure you're looking at the same RSComponent when you find  
all the relationships null?  To me, that is a clear case of  
RSComponent being the target of a mandatory to-one relationship.   
Under certain circumstances, EOF will create an empty EO that's the  
target of that mandatory to-one.


Ken



I'm sure it's not a new, empty instance of the rsComponent..

#1) the rsComponents() relationship is not maditory in the EOModel,  
and it is to-many from RoutingStep (RoutingStep<-->>rsComponent).
#2) I have logging (thanks to EOGenerator) on all my setters, and it  
shows what the previous value was and what the new value is. It is  
taking an object with values, and nullifying them.


Here's an example from the Run Log. See comments within:

Here it sets the routingStep relationship properly (see bottom of  
email for the setRoutingStepRelationship() code).


2007-04-11 07:45:27,282 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setRoutin 
gStepRelationship - updating routingStep from {values =  
{routingStepSequence = 4; instructions = "Fast Blend Oats 10-15- 
SECONDS"; workCenter =  
"_EOIntegralKeyGlobalID[WorkCenter (java.lang.Long)1]>"; routing =  
"_EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1758]>";  
billOfMaterialComponents =  
("583f4c _EOIntegralKeyGlobalID[BillOfMaterialComponent (java.lang.Long) 
8495]>"); routingStepName = "Fast Blend Oats"; toolConfigurations =  
"([RoutingStep (java.lang.Long)7164]>)>"; }; this =  
"_EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7164]>"; } to  
{values = {routingStepSequence = 5; instructions = "Test"; workCenter  
= "_EOIntegralKeyGlobalID[WorkCenter (java.lang.Long)1]>"; routing =  
"_EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1758]>";  
billOfMaterialComponents = (); routingStepName = "Test";  
toolConfigurations =  
"([RoutingStep (java.lang.Long)7167]>)>"; }; this =  
"_EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7167]>"; }


Immediately followed by other misc updates:

2007-04-11 07:45:27,287 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setLineNu 
mber - updating lineNumber from 17 to 17
2007-04-11 07:45:27,354 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setScrapP 
ercent - updating scrapPercent from 0.00 to 0.


Here it begins setting all attributes of the same rsComponent (aka  
BillOfMaterialComponent) to null! you can see by the time stamp that  
it is doing it immediately after the proper update. Also, I can tell  
by the attributes (part.partDescription, etc) that it is, in fact,  
the rsComponent that I requested be updated that is now being nullified.


2007-04-11 07:45:27,356 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setRoutin 
gStepRelationship - updating routingStep from {values =  
{routingStepSequence = 5; instructions = "Test"; workCenter =  
"_EOIntegralKeyGlobalID[WorkCenter (java.lang.Long)1]>"; routing =  
"_EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1758]>";  
billOfMaterialComponents =  
("583f4c _EOIntegralKeyGlobalID[BillOfMaterialComponent (java.lang.Long) 
8495]>"); routingStepName = "Test"; toolConfigurations =  
"([RoutingStep (java.lang.Long)7167]>)>"; }; this =  
"_EOIntegralKeyGlobalID[RoutingStep (java.lang.Long)7167]>"; } to null


[2007-04-11 07:45:27 COT]  Validation failed on an  
object [null] with keypath =  
aRequestedBillOfMaterialBillOfMaterialComponent.lineNumber and  
exception: The lineNumber property of BillOfMaterialComponent is not  
allowed to be null.


2007-04-11 07:45:27,371 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setPartRe 
lationship - updating part from {values = {rawType =  
"(com.webobjects.eoaccess.EOAccessFaultHandler _EOIntegralKeyGlobalID 
[RawType (java.lang.Long)7])>"; unitOfMeasure =  
"_EOIntegralKeyGlobalID[UnitOfMeasure (java.lang.Long)1]>"; lotCodes =  
"((java.lang.Long)424]>)>"; componentOfBillsOfMaterial =  
"(_EOIntegralKeyGlobalID[Raw (java.lang.Long)424]>)>"; statementBlocks  
= "([Raw (java.lang.Long)424]>)>"; partDescription = "Oats, Quick , Oats,  
Quick"; nutritionBlocks =  
"([Raw (java.lang.Long)424]>)>"; partNumber = "020741";  
partType = "(com.webobjects.eoaccess.EOAccessFaultHandler _EOIntegralKeyGlobalID 
[PartType (java.lang.Long)2])>"; partName = "Oats, Quick ";  
workCentersUsedIn =  
"([Raw (java.lang.Long)424]>)>"; }; this =  
"[Raw (java.lang.Long)424]>"; } to null


[2007-04-11 07:45:27 COT]  Validation failed on an  
object [null] with keypath =  
aRequestedBillOfMaterialBillOfMaterialComponent.scrapFixed and  
exception: The scrapFixed property of BillOfMaterialComponent is not  
allowed to be null.


2007-04-11 07:45:27,404 DEBUG  
com.bestmaid.bakeryManagement.routing._BillOfMaterialComponent:setUnitOf 
MeasureRelationship - updating unitOfMeasure from {values 

Re: Updating Nested To-Many Relationship *NOT SOLVED*

2007-04-11 Thread Ken Anderson

David,

Are you sure you're looking at the same RSComponent when you find all  
the relationships null?  To me, that is a clear case of RSComponent  
being the target of a mandatory to-one relationship.  Under certain  
circumstances, EOF will create an empty EO that's the target of that  
mandatory to-one.


Ken

On Apr 10, 2007, at 11:42 PM, David Avendasora wrote:


Okay, I spoke too soon.

It works to change SOME relationships, but not others. Here's what  
it does:


For example, if I change the relationship of a RSComponent from  
RoutingStep 4 to RoutingStep 3, it works as expected, simply  
changing both sides of the RoutingStep<-->>RSComponent  
relationship. BUT, if I then change the same RSComponent  
relationship back from RoutingStep 3 to RoutingStep 4, it also  
updates the relationship as expected, and then it continues on to  
set all the attributes and relationships of the RSComponent to null!


What is causing it to do this extra step of nullifying everything?!

I have also seen it "hijack" the values of an existing RSComponent  
in the target RoutingStep, then nullify all attributes of the  
RSComponent that it hijacked. This effectively makes it look like  
the RSComponent that I was moving from one RoutingStep to another  
disappears, but in fact it's there, just having been updated to  
look exactly like an existing RSComponent.


Very strange.

Dave

On Apr 10, 2007, at 1:29 PM, David Avendasora wrote:


Thanks Ken!

Once I read your message it seems SO obvious. I had to modify my  
EOGenerator template to add the new getter method, but once I did  
that and changed the binding, it works perfectly!


Dave


On Apr 10, 2007, at 1:08 PM, Ken Anderson wrote:


David,

Since you're changing a relationship and you want it to be  
reflected in the model immediately, you'll have to handle the  
action yourself and update the model using  
addObjectToBothSidesOfRelationshipWityKey or  
removeObjectFromBothSidesOfRelationshipWithKey.  If you're  
generating your classes with EOGenerator, you probably have  
methods that do this for you already.


The issue is, the pop up button just changes the value with key  
value coding, without affecting the opposite side of the  
relationship.


What I usually do in these circumstances is add 2 new methods to  
the EO - to replace the KVC normally used.  Something like:


- (RoutingStep) routingStepRelationship {
return this.routingStep();
}

- (void) setRoutingStepRelationship:(RoutingStep) step {
	this.addObjectToBothSidesOfRelationshipWithKey(step,  
"routingStep");

}

Again, these can be auto-generated for you by EOGenerator.  If  
you then change the 'selection' binding of the pop-up from  
'routingStep' to 'routingStepRelationship', KVC will call your  
set method, which will directly manipulate the object graph.


Ken

On Apr 10, 2007, at 1:35 PM, David Avendasora wrote:


I'm going to try to clarify  this a bit:

Here's the structure of my Form, the important part is in bold:


aRouting

















Here's the code for the action of the WOSubmitButton:

public WOComponent applyChangesToRouting() {
return context().page();
}

The critical portion is the relationship of RoutingStep<-- 
>>RSComponent


When I select a different RoutingStep for a RSComponent using  
the WOPopUpButton and click the WOSubmitButton, it does update,  
but when the page comes back, the aRSComponent that I changed  
shows that it is now related to the new RoutingStep, but it is  
actually physically drawn on the page as still being in the  
original RoutingStep.


If I save the changes to the DB, and dump the session and re- 
enter the app, the RSComponent will be in the right location. So  
it seems to me that everything is actually being updated  
correctly, BUT the data being used to draw the page immediately  
after the update is _partially_ old. The original  
routingStep.rcComponents() array still has the old RCComponent  
in it and the new routingStep.rcComponents() array does not yet  
have the RCComponent in it that it should. BUT the  
rcComponent.routingStep() relationship DOES have the correct  
RoutingStep in it.


If I don't save it to the database and then come back in with a  
new session, then I only see half of the updated relationship.


How do I get the RoutingStep.rsComponents() relationship updates  
to show up?


Dave


On Apr 10, 2007, at 7:52 AM, David Avendasora wrote:

Okay, I over-simplified the problem some. On the actual  
component, I'm not saving the changes to the database until the  
user clicks the "save" button. They _could_ save the changes  
after every change, but I want them to be able to revert, undo,  
and redo.


I don't really understand how I can tell a object to update,  
setting relationships

Re: Instance number

2007-04-11 Thread Dev WO

Hi Bruno,

You can use applicationNumber() from WORequest

Xavier




Hello,

How can I get the instance number of an application in Application?
I try number() but It always gives me "-1"...

Thank you.
___
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% 
40anazys.com


This email sent to [EMAIL PROTECTED]



___
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 archive@mail-archive.com


Instance number

2007-04-11 Thread WIESEN Bruno

Hello,

How can I get the instance number of an application in Application?
I try number() but It always gives me "-1"...

Thank you.
___
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 archive@mail-archive.com