Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Check the connection and try to reconnect(EL, Spring)
Check the connection and try to reconnect [message #515364] Thu, 18 February 2010 10:15 Go to next message
Eclipse UserFriend
I use EL and Spring in a RCP-Application.

There're two problems:

1.) Is there an easy way to check the database connection? Currently I create a simple query on the entitymanager and check the result. But I think, there have to be a better solution. I also tried EnityManger#isOpen: This returns always true, even when the connection is lost (strange).

2.) When I lost the connection (deactivate the network-connection) I get the following message:
[EL Fine]: 2010-02-18 15:30:22.108--ServerSession(20612044)--Thread(Thread[Thread-8,5,spring-osgi-extender[7736bd]-threads])--SELECT 1
[EL Info]: 2010-02-18 15:30:22.108--UnitOfWork(20457864)--Thread(Thread[Thread-8,5,spring-osgi-extender[7736bd]-threads])--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query.

But when I reactivate the network connection, nothing happens and the app hangs up.

Has anyone an idea, what I could do?

[Updated on: Thu, 18 February 2010 10:15] by Moderator

Re: Check the connection and try to reconnect [message #515690 is a reply to message #515364] Fri, 19 February 2010 14:22 Go to previous message
Eclipse UserFriend
Hello,

The message indicates that it detected a connection problem and is reestablish the connection and execute the query again. By default, it will make 3 attempts with a 5000 millisecond wait between attempts which can be configured as neccessary. Since it is doing this for you, you should not need to check the connection yourself, but you can if you register an exception handler as described in a response I found from Tom at:
http://markmail.org/message/6p3m62orbv72n7tn

What exactly do you mean by the app hangs up? Is it locked, or just not returning any results? If so, please get a java thread dump and post the relevant threads so we can see what exactly is stuck waiting, and say if you have changed any of the default settings.

Best Regards,
Chris
Previous Topic:EclipseLink weaving for EMF models
Next Topic:eclipselink dynamic weaving not working from remote computer
Goto Forum:
  


Current Time: Sat Jul 19 01:44:05 EDT 2025

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

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

Back to the top