Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 97836 invoked from network); 6 Jun 2006 09:59:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jun 2006 09:59:41 -0000 Received: (qmail 55927 invoked by uid 500); 6 Jun 2006 09:59:41 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 55905 invoked by uid 500); 6 Jun 2006 09:59:41 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 55892 invoked by uid 99); 6 Jun 2006 09:59:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 02:59:40 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [194.95.226.11] (HELO neptun.ecos.de) (194.95.226.11) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 02:59:38 -0700 Received: from localhost (localhost [127.0.0.1]) by neptun.ecos.de (Postfix) with ESMTP id 044364F9355; Tue, 6 Jun 2006 11:59:01 +0200 (MEST) Received: from neptun.ecos.de ([127.0.0.1]) by localhost (fw [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06339-02; Tue, 6 Jun 2006 11:58:59 +0200 (MEST) Received: from lnx1.i.ecos.de (lnx1.i.ecos.de [10.11.11.102]) by neptun.ecos.de (Postfix) with ESMTP id 1D5734FDBC7; Tue, 6 Jun 2006 11:58:59 +0200 (MEST) Received: from venus.gr.ecos.de (venus.gr.ecos.de [10.11.12.1]) by lnx1.i.ecos.de (Postfix) with ESMTP id 0502421CE21; Tue, 6 Jun 2006 11:59:12 +0200 (CEST) From: Gerald Richter Organization: ecos gmbh To: embperl@perl.apache.org Subject: Re: persistent DB connections Date: Tue, 6 Jun 2006 11:59:10 +0200 User-Agent: KMail/1.8 Cc: "Hartmaier Alexander" References: <2812C04B56EA6B43BAFD046B6B9C4763013989D3@MX1MAIL1.int.neonet.at> In-Reply-To: <2812C04B56EA6B43BAFD046B6B9C4763013989D3@MX1MAIL1.int.neonet.at> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606061159.10665.richter@ecos.de> X-Virus-Scanned: by BB-5000 Mailfilter at neptun.ecos.de X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Am Montag, 29. Mai 2006 11:05 schrieb Hartmaier Alexander: > If i use $epapp, where/when should I set it? Can it be done in my apache2 > config? (startup.pl) Same question for the global var... You should not open a db connection in startup.pl because handles will not be valid after the fork of the children. All other data can be setup in the startup.pl and stored in a global variable. The db connection should be opened at the first request to the db. Gerald > > -Alex > > > -----Original Message----- > > From: Gerald Richter [mailto:richter@ecos.de] > > Sent: Monday, May 29, 2006 6:31 AM > > To: Hartmaier Alexander; embperl@perl.apache.org > > Subject: RE: persistent DB connections > > > > > 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 ** > > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* >"* 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. > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* >"* ** 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