Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339830 - How To modify Eclipselink JPA 2.0 connection retry behaviour .
Summary: How To modify Eclipselink JPA 2.0 connection retry behaviour .
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-13 13:32 EDT by mjawath CLA
Modified: 2022-06-09 10:29 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mjawath CLA 2011-03-13 13:32:35 EDT
Build Identifier: 2.0.0

Eclipselink automatically tries to reconnect it self to  database whenever  it detects a connection failure this causes swing ui to freeze without any responses until it connects to database .

Are there any solution to modify this behavior

Ie is it possible to throw exception when connection fails without retrying

Please help on this issue
I am facing with huge problem. 

I went throe eclipselink source code and google but I could not find any solution.

Reproducible: Always
Comment 1 Tom Ware CLA 2011-03-16 08:45:07 EDT
Please go through the mailing list or newsgroups for support.
Comment 2 Michael OBrien CLA 2011-03-16 10:00:56 EDT
Majawath,
  Hi, this is a good question.  If you post your scenario on the following EclipseLink users newsgroup we should be able to help you.  An added benifit of this is you will reach the entire user base as well as all the committers.
  It would benefit your use case if you posted key parts of your architecture like your persistence.xml so we can see how you are using your likely application managed persistence unit.  Also how is your Java SE application using the persistence unit - is it a local Persistence bootstrap EMF or are you communicating to a back end server via say @Remote session beans.

  If you are using a DirectConnector as opposed to a DriverManager and there are no properties available via JPA or orm.xml then maybe we can work something out with a SessionCustomizer or enhance DefaultConnector.directConnect() if you are using it.

  You may post to the following
  http://dev.eclipse.org/mhonarc/lists/eclipselink-users/maillist.html

  thank you
  /Michael
Comment 3 mjawath CLA 2011-03-16 14:17:46 EDT
i am using this to develop swing desktop application 
local emf bootstrap
i used to create jframe and initialise entity managers and use them for crud action

 EntityManager entityManager = Persistence.createEntityManagerFactory("mydb").createEntityManager();

//Database connection is connected
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
       entityManager.createQuery(".....").getResultList();

    }
//if Database connection is disconnected at this point.
// swing gui edt thread will start to hang or freeze in this place..
// because eclipselink is retrying connection for 3 times this is very awful
 

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
        entityManager.createQuery(".....").getResultList();
    }
Comment 4 Tom Ware CLA 2011-03-16 14:46:47 EDT
If you haven't already, please post this via the suggested support channels above.  The audience of those support channels will be much wider.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:29:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink