Tim Bunce <[EMAIL PROTECTED]> schrieb am 27.06.03 02:31:54:
> 
> On Thu, Jun 26, 2003 at 10:03:28PM +0100, [EMAIL PROTECTED] wrote:
> > Tony,
> > 
> > I've tested a bit. Class::DBI objects survive Storable freeze/thaw cyles just fine.
> > To get a standard testring ground I removed my "anti-stringificaton" overload.
> > Modifing PlClient.pm seems to tell me that a string is returned instead of an 
> > object. The ClientObject
> > method is going to create a client stub return object on the next code line after 
> > "die".
> > 
> > sub ClientObject {
> >     my $client = shift;  my $class = shift;  my $method = shift;
> >     my($object) = $client->Call('NewHandle', $class, $method, @_);
> >     die "Constructor didn't return a TRUE value" unless $object;
> > 
> > use Data::Dumper;
> > print( join'#', ref $object, "PlClient", Dumper($object) );
> > 
> >     die "Constructor didn't return an object"
> >  unless $object =~ /^((?:\w+|\:\:)+)=(\w+)/;
> >     RPC::PlClient::Object->new($1, $client, $object);
> > }
> > 
> > Output:
> > 
> > #PlClient#$VAR1 = '2';
> > Constructor didn't return an object at /usr/share/perl5/RPC/PlClient.pm line 127.
> > 
> > '2' is the id string of the correct Class::DBI find_or_create call. Is it worth 
> > trying to
> > make my own simple, non-CDBI-based class, overload stringification and test 
> > RPC::PLClient with it? It looks like
> > it's RPC::PlClient 's fault, not Class::DBI. OTOH the base of DBD::Proxy should be 
> > well tested.
> 
> I don't think there are any DBD::Proxy or RPC::PlClient tests that
> test overload stringification.
> 
> The $object =~ /^((?:\w+|\:\:)+)=(\w+)/; it's using is wrong.
> 
> Something like
> 
>  unless UNIVERSAL::isa($object, 'UNIVERSAL');
> 
> would be better.
> 
> I'd imagine that Jochen Wiedmann [CC'd] would accept a tested patch.

Hi all,

I've tested with the attatched programms that RPC::PlClient does not like 
stringification. Jochen, you can use the code as a test case. Class:DBI just 
exposed the problem.

I'm afraid that changing the "die"-ing test is not sufficient. Storable can 
successfully nfreeze/thaw stringified Class::DBI-Objects. So it must be 
somewhere on the return path in PlClient. I've no clue how the class 
information is preserved / reextracted in transit, espescially because 
RPC::PlClient::Object->new does the reblessing. But the failing test looks 
for something class-like before that, and $object is just a string at this 
time.

Thank you very much for your patience.

Johannes Nie�

______________________________________________________________________________
UNICEF bittet um Spenden fur die Kinder im Irak! Hier online an
UNICEF spenden: https://spenden.web.de/unicef/special/?mc=021101

Attachment: PlClient-Stringification-Test.tar.gz
Description: application/tgz

Reply via email to