Refresh offline status of DB Connections

Questions and answers regarding general SQL and backend databases

Refresh offline status of DB Connections

Postby jd2p » Sat Jan 12, 2013 1:33 am

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
jd2p
 
Posts: 95
Joined: Thu Dec 08, 2011 1:08 am

Re: Refresh offline status of DB Connections

Postby ngervasi » Sat Jan 12, 2013 2:05 am

Can you explain a bit better your setup?
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Refresh offline status of DB Connections

Postby jd2p » Sat Jan 12, 2013 2:19 am

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
jd2p
 
Posts: 95
Joined: Thu Dec 08, 2011 1:08 am

Re: Refresh offline status of DB Connections

Postby ROCLASI » Sat Jan 12, 2013 2:34 am

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Refresh offline status of DB Connections

Postby ngervasi » Sat Jan 12, 2013 2:43 am

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?
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Refresh offline status of DB Connections

Postby ROCLASI » Sat Jan 12, 2013 2:47 am

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Refresh offline status of DB Connections

Postby ngervasi » Sat Jan 12, 2013 2:49 am

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.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Refresh offline status of DB Connections

Postby ROCLASI » Sat Jan 12, 2013 2:59 am

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Refresh offline status of DB Connections

Postby ngervasi » Sat Jan 12, 2013 3:03 am

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.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Refresh offline status of DB Connections

Postby ROCLASI » Sat Jan 12, 2013 3:07 am

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Refresh offline status of DB Connections

Postby jd2p » Sat Jan 12, 2013 2:42 pm

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.
jd2p
 
Posts: 95
Joined: Thu Dec 08, 2011 1:08 am

Re: Refresh offline status of DB Connections

Postby jd2p » Sat Jan 12, 2013 2:43 pm

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.
jd2p
 
Posts: 95
Joined: Thu Dec 08, 2011 1:08 am


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 5 guests