Forum OpenACS Q&A: postgres connection (to maxopen or not)

I am running a 3.2.2 release of openacs with postgres on a remote machine. AOLServer starts up fine and runs for a little while, then it appears that I lose the connection to the database, and am unable to re-connect. I am running aolserver 3.2 and have the 1.1.0 postgres driver downloaded from openacs.org. The messages I am seeing are as follows:

[28/Dec/2000:16:59:31]
    Error: Ns_PgOpenDb(postgres):  Could not connect to
dbserver.private:5432:Prod:  Password authentication failed for user
'aadmin'

[28/Dec/2000:16:59:31]
    Error: dbdrv: failed to open database
'postgres:dbserver.private:5432:Prod'

Any ideas?

So, in an attempt to fix this, I have un-commented the MaxOpen and MaxIdle lines in the nsd.tcl file. I just did this, so I am not sure yet if it will fix my problem...

What are the ramifications of having these two parameters set? What are people's experience with these parameters?

Thanks for any suggestions.

Collapse
Posted by Ryan Campbell on
Take a look at this thread in which Rob Mayoff gives a definition of maxopen & maxidle. As discussed here, setting maxopen and maxidle to 1000000000 essentially prohibits Aolserver from ever releasing a database handle and seems to be the frequent workaround of database & db driver bugs.

However, this is a kludge. While it may allow things to "work", you probably need to fix the underlying problem. Why is authentication failing the second time and not the first?

Collapse
Posted by Sudeep Sakhi on
Hello Chris,

I want to install Aolserver on redHat machine and Oracle 9i on Windows machine. Can u guide me what all should I write in the bash profile of nsadmin user(user installing aolserver) about the ORACLE ENV variables like ORACLE_HOME etc.

Also what are the other changes that need to be done to run Aolserver with a remote databse?

Thanks.
Sudeep.

Collapse
Posted by Andrew Piskorski on
Sudeep, running Oracle on Windows like that is a rather bizarre Oracle setup. However, the fact that the remote Oracle happens to be on a Windows machine should make no difference on the AOLserver side, the configuration is the same as running Oracle on a remote Linux or Solaris box, which is a common configuration for larger OpenACS sites.

I've never done it, but my understanding is you will need to install the Oracle client libraries on the Linux box running AOLserver. Use TCP/IP connection in AOLserver rather than Beqeath - just make sure that ns_param DataSource has the Oracle instance name you defined in the Oracle Listener (e.g., ora8@ora8). Empty string for ns_param DataSource means use Bequeath, and you don't want that. Something like that. (Some of my Oracle terminology probably isn't quite right.)