Hi,
I just started using Rose::DB and have been experiencing certain
database connectivity issues.
DBD::Pg::st execute failed: ERROR: prepared statement "dbdpg_1" already exists
My set up is as follows:
The box runs 2 Apache servers - one on port 80 and the other on port
8080. The former uses Class::DBI and Apache::DBI. The latter uses
Rose::DB and Apache::DBI. They both use the same database server, but
access different databases with different usernames. To isolate the
problem, I stopped the server running on port 80 but was still able to
recreate the problem.
package MSS::DB;
use base qw(Rose::DB);
# Use a private registry for this class
__PACKAGE__->use_private_registry;
# Register your lone data source using the default type and domain
__PACKAGE__->register_db(
driver => 'pg',
database => 'mss_dev',
username => 'mss_dev',
password => '',
);
package MSS::DB::Object;
use MSS::DB;
use base qw(Rose::DB::Object);
sub init_db { MSS::DB->new() }
1;
Also, in my main handler, I do
$r->pnotes( dbh => MSS::DB->new->dbh );
and later use this db handle to access my session data through
Apache::Session::Postgres' tie() interface.
Thanks in advance for any comments/suggestions.
Arsh