Dear all
I'm facing a problem with my DB connections, I have 2 DBs, one life and the other is Backup. Sometimes, the life one due to unexpected error shut down suddenly, and all the pages in OFBiz related to this DB give an error. How can I check if the connection is still available or not, and in case of unavailability, how can I connect to the backup DB in a transparent way?? The DBA advised me to retrieve the data through stored procedures, but as I know, the stored procedure is not supported by OFBiz. Please advice Kind regards ================================== Mamdouh Kaadan |
Which database are you using? Some database drivers are a bit inane by default and don't reconnect to the database automatically. For these there is usually a JDBC uri parameter to turn on this option. Use stored procedures to get the data? I have no idea how this would help with a lost connection problem... but it certainly does follow the what has been the database design and DBA agenda for the first few decades of the life of databases... ;) -David On Aug 27, 2006, at 10:37 AM, Mamdouh Kaadan wrote: > Dear all > > > > I'm facing a problem with my DB connections, I have 2 DBs, one life > and > the other is Backup. > > Sometimes, the life one due to unexpected error shut down suddenly, > and > all the pages in OFBiz related to this DB give an error. > > > > How can I check if the connection is still available or not, and in > case > of unavailability, how can I connect to the backup DB in a transparent > way?? > > The DBA advised me to retrieve the data through stored procedures, but > as I know, the stored procedure is not supported by OFBiz. > > > > Please advice > > > > Kind regards > > > > ================================== > > Mamdouh Kaadan > > > > > |
In reply to this post by Mamdouh Kaadan-2
I'm using oracle DB.
For stored procedures, I can create 2 db links to the 2 db (life and backup) on my schema, and inside the stored procedure I can do the following: Retrieve the data from the life one, If no data found then retrieve the data from the backup one ================================== Mamdouh Kaadan -----Original Message----- From: David E Jones [mailto:[hidden email]] Sent: Sunday, August 27, 2006 8:39 PM To: [hidden email] Subject: Re: Check DB connection availability Which database are you using? Some database drivers are a bit inane by default and don't reconnect to the database automatically. For these there is usually a JDBC uri parameter to turn on this option. Use stored procedures to get the data? I have no idea how this would help with a lost connection problem... but it certainly does follow the what has been the database design and DBA agenda for the first few decades of the life of databases... ;) -David On Aug 27, 2006, at 10:37 AM, Mamdouh Kaadan wrote: > Dear all > > > > I'm facing a problem with my DB connections, I have 2 DBs, one life > and > the other is Backup. > > Sometimes, the life one due to unexpected error shut down suddenly, > and > all the pages in OFBiz related to this DB give an error. > > > > How can I check if the connection is still available or not, and in > case > of unavailability, how can I connect to the backup DB in a transparent > way?? > > The DBA advised me to retrieve the data through stored procedures, but > as I know, the stored procedure is not supported by OFBiz. > > > > Please advice > > > > Kind regards > > > > ================================== > > Mamdouh Kaadan > > > > > |
Oracle does have support for clustered databases, so I'd recommend using that for this. Clustering is really what is intended to solve this sort of problem. If it was something other than Oracle, you could use something like the C-JDBC driver. -David On Aug 28, 2006, at 1:56 AM, Mamdouh Kaadan wrote: > I'm using oracle DB. > For stored procedures, I can create 2 db links to the 2 db (life > and backup) on my schema, and inside the stored procedure I can do > the following: > Retrieve the data from the life one, > If no data found then retrieve the data from the backup one > > ================================== > Mamdouh Kaadan > > > > -----Original Message----- > From: David E Jones [mailto:[hidden email]] > Sent: Sunday, August 27, 2006 8:39 PM > To: [hidden email] > Subject: Re: Check DB connection availability > > > Which database are you using? Some database drivers are a bit inane > by default and don't reconnect to the database automatically. For > these there is usually a JDBC uri parameter to turn on this option. > > Use stored procedures to get the data? I have no idea how this would > help with a lost connection problem... but it certainly does follow > the what has been the database design and DBA agenda for the first > few decades of the life of databases... ;) > > -David > > > On Aug 27, 2006, at 10:37 AM, Mamdouh Kaadan wrote: > >> Dear all >> >> >> >> I'm facing a problem with my DB connections, I have 2 DBs, one life >> and >> the other is Backup. >> >> Sometimes, the life one due to unexpected error shut down suddenly, >> and >> all the pages in OFBiz related to this DB give an error. >> >> >> >> How can I check if the connection is still available or not, and in >> case >> of unavailability, how can I connect to the backup DB in a >> transparent >> way?? >> >> The DBA advised me to retrieve the data through stored procedures, >> but >> as I know, the stored procedure is not supported by OFBiz. >> >> >> >> Please advice >> >> >> >> Kind regards >> >> >> >> ================================== >> >> Mamdouh Kaadan >> >> >> >> >> > |
Free forum by Nabble | Edit this page |