[Zope-Perl] ZDBI_DA from Perl Method (was: still struggling with Zope-Perl on Solaris Sparc)

Monty Taylor mtaylor@goldridge.net
Tue, 22 Aug 2000 09:38:28 +0200


Harry Danilevsky wrote:
> 
> Success!! After I installed Zope 2.2 (compiling it from source)
> I got PerlMethod, PerlExternalMethod and ZDBI_DA up
> (consider it a port to Sparc Solaris :-)

Cool. That helps me out. (Actually, I was using the fact that this
didn't
work under Solaris as a justification for moving part of a Solaris to
Linux 
migration forward some, so maybe I'll just keep this to myself, but cool
anyway)
 
> My next problem: How do I pass a DBI connection object to
> my perl method? I can open a connection inside Perl code,
> execute SQL and get results back. I can also create a
> ZDBI_DA connection object, and open a connection.
> 
> If I try to call perl method passing the connection
> perl code seems to receive just a string with connection name.
> (say, connection object Id is DVMT, and perl method
> is declared to expect 1 parameter: connection. I "Try it",
> giving DVMT as connection parameter value: - is this the right syntax?)

I haven't tried this, so don't shoot me if I'm wrong, but instead of
passing the
ZDBI_DA connection in, you should be able to get to it through the
'parent' object.
Actually, yes and no. Pass in the connection, then look through parent
for an object 
matching the string that you get from having passed in the connection
(following?)
So you would have $parent{$connection}->execute(); or some such thing. 

I'll try this later when I can get around to it, but that may be a bit,
so let me know
if it works/makes sense.

> 
> Harry Danilevsky
> harry@siichi.com

Monty