On Sat, 2005-09-24 at 15:52 +0100, David Baird wrote: 
> 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?

Yes.

Is the Class::DBI::Loader::Pg responsible for using the parameters?
Maybe there is a chance that the { AutoCommit => 1 } is being ignored
somewhere?

> > 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;

With this option nothing changed.

> 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.

Got some strange error:

[Sun Sep 25 09:54:17 2005] [error] Can't use an undefined value as an
ARRAY reference
at /usr/local/share/perl/5.8.7/Maypole/Plugin/Relationship.pm line
58.\nCompilation failed in require at (eval 10) line 3.\n
file error - frontpage: not found
at /usr/local/share/perl/5.8.7/Maypole.pm line 123

I guess I must use some Config:: module right?
-- 
Paulo Silva <[EMAIL PROTECTED]>
Eurotux Informática, S.A.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to