Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [teneo]recover bad connections([teneo]recover bad connections)
[teneo]recover bad connections [message #1255675] Mon, 24 February 2014 18:01 Go to next message
Rachna Bakhru is currently offline Rachna BakhruFriend
Messages: 45
Registered: July 2009
Member
How do you recover from bad connections?
HbHelper hbHelper = HbHelper.INSTANCE;
HbDataStore hbDataStore = hbHelper.getDataStore(connName);
SessionFactory sessFac = hbDataStore.getSessionFactory();

Now if someone accidently restarts the database server while the app is still running.

I get this error
java.sql.SQLRecoverableException: No more data to read from socket

Is there a way to check the health of the HbDataStore and if it is not valid call
HbDataStore hbds = (HbDataStore)hbHelper.createRegisterDataStore(connName) again.
Re: [teneo]recover bad connections [message #1255768 is a reply to message #1255675] Mon, 24 February 2014 20:09 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi RJ,
I don't think you need to create a new datastore. But not sure how you want to recover from a database restart while the
app is running. At least the current used connections will fail. New connections will again login to the restarted db
server.

You can also use connection pooling, many connection pools do check connections for validity before giving the
connection to the app.

gr. Martin

On 02/24/2014 07:01 PM, RJ Mising name wrote:
> How do you recover from bad connections?
> HbHelper hbHelper = HbHelper.INSTANCE;
> HbDataStore hbDataStore = hbHelper.getDataStore(connName);
> SessionFactory sessFac = hbDataStore.getSessionFactory();
>
> Now if someone accidently restarts the database server while the app is still running.
>
> I get this error
> java.sql.SQLRecoverableException: No more data to read from socket
>
> Is there a way to check the health of the HbDataStore and if it is not valid call
> HbDataStore hbds = (HbDataStore)hbHelper.createRegisterDataStore(connName) again.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Issue with the definition of gmf.nodes
Next Topic:[EMFStore][EMFClient] Using the EMFStore for simple storage
Goto Forum:
  


Current Time: Fri Apr 26 18:37:19 GMT 2024

Powered by FUDForum. Page generated in 0.03624 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top