openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron <CAOSW1...@GMAIL.COM>
Subject IO error : Connection timed out
Date Thu, 01 Aug 2013 10:01:01 GMT
Hello everybody, 

I'm having some problems configuring openJPA, I'm optaining a EntityManager
manually from the 
EnitityManagerFactory. Occasionally, when the query.getResultList() is
executed, it spend 15 minutes to get the following exception: 

[2013-07-20 *08:59:51,576*][httpWorkerThread-80-79]    INFO - XXXXXXXXX
execute start 
[2013-07-20 *09:15:21,293*][httpWorkerThread-80-79]    ERROR - IO error :
Connection timed out {prepstmnt 1394416654 SELECT XXXXXXXXXXX} [code=17002,
state=08006] 

The sql is very simple, in normal times, it spend 0.2 seconds to get result. 

my persistence.xml : 
<property name="openjpa.ConnectionURL" value="jdbc:oracle:thin:@(DESCRIPTION
= (ADDRESS = (PROTOCOL = TCP)(HOST = IP1)(PORT = 1521)) (ADDRESS = (PROTOCOL
= TCP)(HOST = IP2)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA =(SERVER
= DEDICATED)(SERVICE_NAME = SERVICE_NAME )))"/>
<property name="openjpa.jdbc.DBDictionary" value="oracle"/>
<property name="openjpa.ConnectionDriverName"
value="oracle.jdbc.driver.OracleDriver"/>
<property name="openjpa.ConnectionUserName" value="username"/>
<property name="openjpa.ConnectionPassword" value="password"/>

My questions here are: 
1. Why takes 15 minutes to get exception? 
2. How can I avoid this exception´╝č 

by the way, I try the following persistence.xml, but it doesn't work. 
<property name="openjpa.ConnectionProperties"
value="DriverClassName=oracle.jdbc.driver.OracleDriver, 
              Url=jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL =
TCP)(HOST = IP1)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = IP2)(PORT
= 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA =(SERVER =
DEDICATED)(SERVICE_NAME = SERVICE_NAME ))), 
              MaxActive=30, MaxWait=10000, TestOnBorrow=true,
TestWhileIdle=true, 
              validationQuery='select 1 from dual', Username=username,
Password=password"/>
<property name="openjpa.ConnectionDriverName"
value="org.apache.commons.dbcp.BasicDataSource"/>



--
View this message in context: http://openjpa.208410.n2.nabble.com/IO-error-Connection-timed-out-tp7584624.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message