On 9/24/05, Paulo Silva <[EMAIL PROTECTED]> wrote:
> On Sat, 2005-09-24 at 13:17 +0100, David Baird wrote:
> > See the Maypole FAQ at http://maypole.perl.org/?FAQ - How do I get
> > beerdb working with Postgres?
>
> I've checked the connection string and the Class::DBI::Loader::Pg.pm
> file and all seems ok.
Did you set { AutoCommit => 1 } in the connection parameters?
> It's a strange behavior. If I add/remove an entry to a table from the
> site, it remains added/removed in the site, I can reload the page and it
> seems like the modification was committed. If I do a select with the
> psql client, I'm unable to see any modification, it's like if some cache
> mechanism isn't committing the changes to the database but displays the
> changes in the page.
If you have AutoCommit => 1, then this sounds like a problem with the
CDBI object index. This in turn would be caused by an unintended
closure somewhere in your code. Try adding this line
$Class::DBI::Weaken_Is_Available = 0;
which is a hack to prevent CDBI object index problems. If adding that
line works, then you know you have a closure somewhere that needs to
be fixed. More details here:
http://wiki.class-dbi.com/index.cgi?CommonProblems
>
> > Also, have a look at Maypole::Application. Instead of saying this:
> >
> > > use base 'Apache::MVC';
> > > use Class::DBI::Loader::Relationship;
> >
> > you'd say
> >
> > use Maypole::Application;
> >
> > As your app develops, working via Maypole::Application will help keep
> > things simpler.
> >
> > d.
>
> After replacing
>
> > use base 'Apache::MVC';
> > use Class::DBI::Loader::Relationship;
>
> with
>
> > use Maypole::Application;
>
> the apache logs started displaying errors:
>
> [Sat Sep 24 13:50:35 2005] [error] Can't locate object method
> "relationship" via package "Class::DBI::Loader::Pg"
> at /var/www/perl/CD.pm line 14.\nCompilation failed in require at (eval
> 10) line 3.\n
>
> After re-adding the Class::DBI::Loader::Relationship, the error
> disappears. Is this normal?
Sorry, missed a bit out. Remove the Class::DBI::Loader::Relationship, and say
use Maypole::Application qw( Relationship );
That loads Maypole::Plugin::Relationship, which loads
CDBI::Loader::Relationship.
d.
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users