Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA Timeouts(Detecting and setting timeouts in lost connection)
JPA Timeouts [message #1007822] Thu, 07 February 2013 16:18
Vaclav Tuma is currently offline Vaclav TumaFriend
Messages: 7
Registered: April 2011
Junior Member
Hello all,

Im have a 'little fight' with timeouts.

Using: eclipselink-2.4.1 libraries
with Oracle database (I will try
Type application: J2SE Java 1.6

Setting of Persistence properties (Im writting here only the timeout keys)

<!-- Timeouts in [ms]-->
key="eclipselink.jdbc.connection_pool.default.wait" value="2000"
<!-- Timeouts in [s]-->
key="javax.persistence.query.timeout" value="120"

I try to some how simulate and handle loosing the connection to database.
I hope that following problem is only about my not understanding the right way to of eclipselink timeout usage.

Application created factory, then entity manager, so its connected.
Then I plugg off the cable from db server (like a simulation of lost connection).

When the time is "short" after plugging cable in, JPA works, query is selected and it works,

But when time is longer 3 or 5 minutes, no exception are rised till the cable is not plugged in again. After that the is caught SQL Exception. -> But its AFTER connecting the cable.

Second - similar situation occurs when i try to disconnect with cable plugged out. Closing entity manager is ok, but closing factory is still frozen till I connect the cable into pc again.

Is there a simple way to solve my problems. All I need is detect that database server is unavailable in timeout and close the connection (or/and cancel the query etc.)

Thank you for your advices and time
Previous Topic:eclipselink flush mode out of memory
Next Topic:@Index with an@ElementCollection
Goto Forum:

Current Time: Tue Jun 19 03:32:44 GMT 2018

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

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

Back to the top