[Maypole] table confusion w/multiple apps in same vhost?
Matthew Kalastro
mk@calcentral.com
Fri, 4 Jun 2004 11:56:46 -0700
Hello,
My database tables are getting confused when running two basic Maypole
apps on the same virtual host, from two different <Location>'s. The
tables from the 1st app below appear in the views from the 2nd app, and
visa versa, depending on which app is loaded first after server restart.
I'd like to be able to do this. Putting the apps in separate virtual
hosts solved the problem if I don't preload the main app configuration
module ("<Perl> use SOE::DoorAccess; </Perl>").
Is this expected behavior? Could I "superclass" Apache::MVC to avoid
this confusion? Any ideas appreciated.
Here's what I'm using:
1st app: SOE/DoorAccess.pm:
package SOE::DoorAccess;
=20
use base 'Apache::MVC';
use Class::DBI::Loader::Relationship;
=20
SOE::DoorAccess -> setup (
"dbi:mysql:host=3Dlocalhost;database=3DDoorAccess",
"dbuser", "dbpass" );
=20
SOE::DoorAccess -> config -> {uri_base} =3D
"http://apps.soe.ucsc.edu:82/door_access/";
=20
...database setup...
Apache config:
# Door Access application
<Perl>
# includes SOE/DoorAccess.pm
use lib '/home/local/httpdocs/content/htdocs/door_access/lib';
</Perl>
<Location /door_access >
SetHandler perl-script
PerlHandler SOE::DoorAccess
</Location>
2nd app: SOE/CEPortfolio/WebApp.pm
package SOE::CEPortfolio::WebApp;
=20
use base 'Apache::MVC';
use Class::DBI::Loader::Relationship;
=20
SOE::CEPortfolio::WebApp -> setup (
"dbi:mysql:host=3Dlocalhost;database=3DCEPortfolio" .
"dbuser", "dbpass" );
=20
SOE::CEPortfolio::WebApp -> config -> {uri_base} =3D
"http://apps.soe.ucsc.edu:82/ce_portfolio/";
=20
...database setup...
Apache config:
# CE Portfolio
<Perl>
# includes SOE/CEPortfolio.pm
use lib '/home/local/httpdocs/content/htdocs/ce_portfolio/lib';
</Perl>
<Location /ce_portfolio >
SetHandler perl-script
PerlHandler SOE::CEPortfolio::WebApp
</Location>
Maypole is really cool, and could save me tons of development time.
Thanks Simon!
Thanks a lot,
Matt