Page 1 of 1

Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 1:33 am
by jd2p
Hello everyone,

Here's my issue, the database server starts after the application server (the DB resides in a Virtual Machine running on the application server) and the Servoy Application Server is configured to start automatically as a service. So, this makes the database connections on the Application Server appear offline until they're manually refreshed (open the connections one by one and click on save settings without making changes). The same thing happens if the DB Server gets restarted.

You might ask: "Is it too hard to just refresh the connections?!". Well, for one, we have serveral connections but the main concern is that we have various customers in rural areas and they only speak spanish. So, yeah, we do our best to keep it as simple and painless as possible.

Thanks for any help!

JD

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 2:05 am
by ngervasi
Can you explain a bit better your setup?

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 2:19 am
by jd2p
Sure.

I have a physical server (lets call it serverA) that has the Servoy Application Server installed. Inside this server is a Virtual Machine (serverV) that runs an Oracle Database. When serverA starts, the servoy application server is configured to automatically start. Afterwards, the serverV is started and with it the Oracle Database. So, naturally, when serverA starts the database is not online.

Is there a way to have the application server automatically refresh the status of the connections? Or somehow create a service that does this?

Thanks,

JD

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 2:34 am
by ROCLASI
Hi JD,

Apart from any error logging, does it really interfere with your functionality ?
Usually database connections will work correctly when they can have a correct connection.
For instance MySQL (yes, an Oracle product) is infamous for dropping connections, but after the initial error logging it just works again.

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 2:43 am
by ngervasi
Weird setup... I guess you have your reasons for that though.
Can't you install the servoy application server inside the Oracle virtual machine? Or maybe inside another VM that starts up AFTER the db one?

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 2:47 am
by ROCLASI
I would say put the application server and the db server in same VM because they are bound together anyway.
Especially when they are on the same bare metal anyway.

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 2:49 am
by ngervasi
Robert, if I remember correctly if at startup a db connection can't be established it gets disabled and won't be used/brought up by a client. Not sure 100% though.
A fast (but inelegant) solution would be to edit the servoy application startup script and check the db availability before starting the application server.

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 2:59 am
by ROCLASI
Hi Nicola,

For instance by adding '?autoReconnect=true' to the connection string in MySQL it will error (a lot) but will keep working.
I haven't seen any other database connections (Oracle, MSSQL, PostgreSQL) yet drop while actually active (unlike MySQL) so I can't really tell.
Then again I have seen outside forces at work (VPN in this case) where Oracle connections simply dropped and won't even reconnect. I guess your milage may vary.

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 3:03 am
by ngervasi
Yes, we both agree that the best solution is to install servoy in the same VM as the Oracle Db, that makes also easier to deploy and update IMO.

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 3:07 am
by ROCLASI
Yes,

As a general rule you should use: 'make sure you start the RDBMS first before ANY client services'.
It's as simple as that.

Clients start AFTER the Service starts up.

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 2:42 pm
by jd2p
ROCLASI wrote:Hi JD,

Apart from any error logging, does it really interfere with your functionality ?


Yep, my application doesn't run because the connections are offline, even though the database is up.

Re: Refresh offline status of DB Connections

PostPosted: Sat Jan 12, 2013 2:43 pm
by jd2p
Ok, I hear you guys, I will install servoy in the same machine as the DB. I'll guess I'll have a dependency to the servoy service so that it doens't start until Oracle finishes starting up.

Thanks.