<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Hi Simon,<br>
<br>
Reducing the number of connections to the database from three to one
will reduce the responsiveness and will definitely hurt when trying to
debug issues (performance, etc).&nbsp; My recommendation is that each
application have at least one unique connection to the database.<br>
<br>
jason<br>
<br>
<br>
On 09/07/2010 12:59 PM, Simon Miner wrote:
<blockquote
 cite="mid:AANLkTinW_u11eUjUjSJbrqLW8++tAfgyHruT=f4BJZmL@mail.gmail.com"
 type="cite">Hi,<br>
  <br>
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1">
  <meta name="ProgId" content="Word.Document">
  <meta name="Generator" content="Microsoft Word 12">
  <meta name="Originator" content="Microsoft Word 12">
  <link rel="File-List"
 href="file:///C:%5CDOCUME%7E1%5CSDM%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml">
  <link rel="themeData"
 href="file:///C:%5CDOCUME%7E1%5CSDM%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx">
  <link rel="colorSchemeMapping"
 href="file:///C:%5CDOCUME%7E1%5CSDM%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:roman;
        mso-font-pitch:variable;
        mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;
        mso-font-alt:"Times New Roman";
        mso-font-charset:0;
        mso-generic-font-family:swiss;
        mso-font-pitch:variable;
        mso-font-signature:-1610611985 1073750139 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-unhide:no;
        mso-style-qformat:yes;
        mso-style-parent:"";
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        mso-bidi-font-size:11.0pt;
        font-family:"Arial","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
span.EmailStyle15
        {mso-style-type:personal;
        mso-style-noshow:yes;
        mso-style-unhide:no;
        mso-ansi-font-size:10.0pt;
        mso-bidi-font-size:11.0pt;
        font-family:"Arial","sans-serif";
        mso-ascii-font-family:Arial;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-default-props:yes;
        mso-ascii-font-family:Calibri;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Calibri;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;
        mso-header-margin:.5in;
        mso-footer-margin:.5in;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
  </style>
  <p class="MsoNormal">I am running 3 separate Catalyst (version
'5.80022) apps
that use a common (Oracle 11g) database.<span style="">&nbsp;
  </span>Each app has a model class which wraps around a common DBIC
schema
class, like so.</p>
  <p class="MsoNormal">-----</p>
  <p class="MsoNormal">package App1::Model::DB;</p>
  <p class="MsoNormal">&nbsp;</p>
  <p class="MsoNormal">use strict;</p>
  <p class="MsoNormal">use base 'Catalyst::Model::DBIC::Schema';</p>
  <p class="MsoNormal">&nbsp;</p>
  <p class="MsoNormal">__PACKAGE__-&gt;config(</p>
  <p class="MsoNormal"><span style="">&nbsp;&nbsp;&nbsp; </span>schema_class =&gt;
Common::DB::Schema',</p>
  <p class="MsoNormal">);</p>
  <p class="MsoNormal">1;<br>
  </p>
  <br clear="all">
  <p class="MsoNormal">-----</p>
  <p class="MsoNormal">package App2::Model::DB;</p>
  <p class="MsoNormal">&nbsp;</p>
  <p class="MsoNormal">use strict;</p>
  <p class="MsoNormal">use base 'Catalyst::Model::DBIC::Schema';</p>
  <p class="MsoNormal">&nbsp;</p>
  <p class="MsoNormal">__PACKAGE__-&gt;config(</p>
  <p class="MsoNormal"><span style="">&nbsp;&nbsp;&nbsp; </span>schema_class =&gt;
Common::DB::Schema',</p>
  <p class="MsoNormal">);</p>
  <p class="MsoNormal">1;</p>
  <p class="MsoNormal">-----</p>
  <p class="MsoNormal">package App3::Model::DB;</p>
  <p class="MsoNormal">&nbsp;</p>
  <p class="MsoNormal">use strict;</p>
  <p class="MsoNormal">use base 'Catalyst::Model::DBIC::Schema';</p>
  <p class="MsoNormal">&nbsp;</p>
  <p class="MsoNormal">__PACKAGE__-&gt;config(</p>
  <p class="MsoNormal"><span style="">&nbsp;&nbsp;&nbsp; </span>schema_class =&gt;
Common::DB::Schema',</p>
  <p class="MsoNormal">);</p>
  <p class="MsoNormal">1;</p>
  <p class="MsoNormal">-----<br>
  </p>
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1">
  <meta name="ProgId" content="Word.Document">
  <meta name="Generator" content="Microsoft Word 12">
  <meta name="Originator" content="Microsoft Word 12">
  <link rel="File-List"
 href="file:///C:%5CDOCUME%7E1%5CSDM%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml">
  <link rel="themeData"
 href="file:///C:%5CDOCUME%7E1%5CSDM%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx">
  <link rel="colorSchemeMapping"
 href="file:///C:%5CDOCUME%7E1%5CSDM%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:roman;
        mso-font-pitch:variable;
        mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;
        mso-font-alt:"Times New Roman";
        mso-font-charset:0;
        mso-generic-font-family:swiss;
        mso-font-pitch:variable;
        mso-font-signature:-1610611985 1073750139 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-unhide:no;
        mso-style-qformat:yes;
        mso-style-parent:"";
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        mso-bidi-font-size:11.0pt;
        font-family:"Arial","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
span.EmailStyle15
        {mso-style-type:personal;
        mso-style-noshow:yes;
        mso-style-unhide:no;
        mso-ansi-font-size:10.0pt;
        mso-bidi-font-size:11.0pt;
        font-family:"Arial","sans-serif";
        mso-ascii-font-family:Arial;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-default-props:yes;
        mso-ascii-font-family:Calibri;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Calibri;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;
        mso-header-margin:.5in;
        mso-footer-margin:.5in;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
  </style>
  <p class="MsoNormal">This setup passes changes to the
Common::DB::Schema class on to the
Catalyst app model classes.</p>
  <p class="MsoNormal">&nbsp;</p>
  <p class="MsoNormal">All three of these apps run under a single
Apache 1.3.42/mod_perl
1.31 server.<span style="">&nbsp; </span>It appears that each server
process creates a unique database connection variable for each of these
apps.
Although these database connections get reused from request to request,
I would
like to make things even more efficient by having a single database
connection
variable per server process which gets shared across all 3 Catalyst
apps. <span style="">&nbsp;</span>How do I update my model to accomplish
this?</p>
  <p class="MsoNormal">&nbsp;</p>
  <p class="MsoNormal">Thanks.</p>
  <br>
-- <br>
-- Simon<br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
List: <a class="moz-txt-link-abbreviated" href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a>
Listinfo: <a class="moz-txt-link-freetext" href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a>
Searchable archive: <a class="moz-txt-link-freetext" href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a>
Dev site: <a class="moz-txt-link-freetext" href="http://dev.catalyst.perl.org/">http://dev.catalyst.perl.org/</a>
  </pre>
</blockquote>
<br>
</body>
</html>