|JPA Timeouts [message #1007822]
||Thu, 07 February 2013 16:18
| Vaclav Tuma
Registered: April 2011
Hello all, |
Im have a 'little fight' with timeouts.
Using: eclipselink-2.4.1 libraries
with Oracle 10.2.0.1.0 database (I will try 10.2.0.3.0)
Type application: J2SE Java 1.6
Setting of Persistence properties (Im writting here only the timeout keys)
<!-- Timeouts in [ms]-->
<!-- Timeouts in [s]-->
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
Powered by FUDForum
. Page generated in 0.02078 seconds