Derek,

When you create a Java Object from Perl, that Java object is bound
the Perl reference that is returned. When that reference goes out of scope,
the Java object is "unhooked" and is free to be collected by the garbage
collector.

So after each time a CGI is called, all the variables allocated during it's
lifetime are destroyed because the perl interpreter dies. Unless you are using
Apache::Registry (?) or mod_perl module or another technique to keep your
CGI persistent.


It is also possible that I'm not understanding your problem correctly.
Please provide more info on your setup (type of CGI, use of mod_perl, ...).
It possible, the (non-business part of the) code is always useful.


Cheers,

Patrick


Peters Derek S Contr WRALC/LGEA wrote:

Hello,

I have a question about Inline::Java and keeping a object persistant. I am
using Inline::Java as an interface to connect to a datasource. The problem
is that every time I want to do a new query, I have to connect again because
the object that I had already created has been destroyed. Is there a way to
store the object in Perl that will allow me to do multiple queries from
differnent cgi's. I have been unable to find any inforamtion about this
process.



Debugging returns


[perl][2]  creating object in java (J::jm):
[perl][1] load done.
[perl][2]  destroying object in java (J::jm):


I am using Apache/2.0.52 (Unix) mod_perl/1.99_17 Perl/v5.8.5 and Inline-0.44 and Inline::Java-0.49

Thanks,
Derek Peters






--
=====================
Patrick LeBoutillier
Laval, Quebec, Canada



Reply via email to