You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Hartmaier Alexander <Al...@t-systems.at> on 2006/05/22 15:41:28 UTC

persistent DB connections

Once again.

It seems that our app has a dbh leak. The sessions to our Oracle db increase and never get closed or used again.

I want to use my DBIx::Class module to access the db and want to store a DBIx::Class::Schema object which holds a db connection somewhere, so I can access it from my embperl pages and my embperl library I include with

Execute ({ inputfile => 'nacadminlib.epl', import => 1 });

in every page.

I looked at the Embperl docs but couldn’t find a solution.

Put it in $epreq, or $epapp?

How to do it to get one per apache2 child?

 

Thanks in advance!

 

-Alex

 

*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

RE: persistent DB connections

Posted by Gerald Richter <ri...@ecos.de>.
> 
> I want to use my DBIx::Class module to access the db and want 
> to store a DBIx::Class::Schema object which holds a db 
> connection somewhere, so I can access it from my embperl 
> pages and my embperl library I include with
> 
> Execute ({ inputfile => 'nacadminlib.epl', import => 1 });
> 
> in every page.
> 
> I looked at the Embperl docs but couldn't find a solution.
> 
> Put it in $epreq, or $epapp?
> 
> How to do it to get one per apache2 child?
> 

Putting it in $epapp should work, but will get a db handle for every
different name you specify with Embperl_App in your httpd.conf file.

The other possibility is to put it in a global variable, then you will get a
handle per Apache child

Gerald


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org