Spinning wheel when trying to connect

I am using a Xojo 2013 r3.1 desktop app accessing a remote PostgreSQL 9.1 database using Mac OS 10.6.8.

I have a database class (mydbase) with the method “IsAvailable” which is:

Me.host="123.456.0.789" Me.SSLMode = PostgreSQLDatabase.SSLRequire Me.port=5432 Me.databaseName="mydata" Me.userName=app.myusername Me.Password=app.mypassword Return Me.Connect

When accessing the database, I use the following method:

If mydbase.IsAvailable then //Do some database stuff mydbase.close else msgBox "There was an error accessing the database." End if

So the database is closed after each call to the database.

Everything works well until the computer sits idle for a while, then the desktop app presents a spinning wheel which goes on indefinitely.

Checked the Energy Saver prefs and computer sleep is set to “Never”.
Also, there is a wired connection to the router (not wireless).

Does this have something to do with the SSL connection? Do I have to do something to keep that alive?