oracle11g - JDBC and Oracle 11g connection reset on ubuntu -


i having strange issue connection jdbc oracle 11g. started happening monday without settings changes either me or team aware of. reading in stackoverflow , oracle forums (see links @ bottom) i've learned there has been issue generation of random bytes on linux 64bit machines. led try several things, unfortunately didn't work. here summary of information i'm aware of.

the weird thing is can connect on terminal using sqlplus, not using jdbc.

thank ideas or help,

amit

my setup:

os: ubuntu 12.04 java: both 7 , 6_45 (issue same) jdbc: downloaded oracle official site (see further description down)     connection behind cisco vpn 

jdbc-manifests:

odbc7.jar:

manifest-version: 1.0 ant-version: apache ant 1.7.1 created-by: 20.12-b01 (sun microsystems inc.) implementation-vendor: oracle corporation implementation-title: jdbc implementation-version: 12.1.0.1.0 repository-id: javavm_12.1.0.1.0_linux.x64_130403 specification-vendor: sun microsystems inc. specification-title: jdbc specification-version: 4.0 main-class: oracle.jdbc.oracledriver sealed: true  name: oracle/sql/converter/ sealed: false  name: oracle/sql/ sealed: false  name: oracle/sql/converter_xcharset/ sealed: false 

odbc6.jar:

manifest-version: 1.0 ant-version: apache ant 1.7.1 created-by: 20.12-b01 (sun microsystems inc.) implementation-vendor: oracle corporation implementation-title: jdbc implementation-version: 12.1.0.1.0 repository-id: javavm_12.1.0.1.0_linux.x64_130403 specification-vendor: sun microsystems inc. specification-title: jdbc specification-version: 4.0 main-class: oracle.jdbc.oracledriver sealed: true  name: oracle/sql/converter/ sealed: false  name: oracle/sql/ sealed: false  name: oracle/sql/converter_xcharset/ sealed: false 

on friday still working:

  • i start application , have java connection oracle db.
  • since monday i'm having issue
  • my old computer (ubuntu 12.04) well, hadn't touched week started having issue too, though left in working state.

terminal connection using sqlplus working:

amit@mymachine:/usr/lib/oracle$ sqlplus /@db_host_ip:1521/db_name

sql*plus: release 12.1.0.1.0 production on tue apr 22 11:35:58 2014

copyright (c) 1982, 2013, oracle. rights reserved.

connected to: oracle database 11g release 11.2.0.3.0 - 64bit production

sql>

but connection jdbc failing:

drivermanager.getconnection(                     "jdbc:oracle:thin:@//db_host_ip:1521/db_name", username,                     password); 

hangs 20 seconds , throws:

ava.sql.sqlrecoverableexception: io error: connection reset     @ oracle.jdbc.driver.t4cconnection.logon(t4cconnection.java:682)     @ oracle.jdbc.driver.physicalconnection.<init>(physicalconnection.java:711)     @ oracle.jdbc.driver.t4cconnection.<init>(t4cconnection.java:385)     @ oracle.jdbc.driver.t4cdriverextension.getconnection(t4cdriverextension.java:30)     @ oracle.jdbc.driver.oracledriver.connect(oracledriver.java:558)     @ java.sql.drivermanager.getconnection(drivermanager.java:582)     @ java.sql.drivermanager.getconnection(drivermanager.java:185)     @ oraclejdbc.main(oraclejdbc.java:32)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25)     @ java.lang.reflect.method.invoke(method.java:597)     @ com.intellij.rt.execution.application.appmain.main(appmain.java:120) caused by: java.net.socketexception: connection reset     @ java.net.socketinputstream.read(socketinputstream.java:168)     @ oracle.net.ns.packet.receive(packet.java:311)     @ oracle.net.ns.datapacket.receive(datapacket.java:105)     @ oracle.net.ns.netinputstream.getnextpacket(netinputstream.java:305)     @ oracle.net.ns.netinputstream.read(netinputstream.java:249)     @ oracle.net.ns.netinputstream.read(netinputstream.java:171)     @ oracle.net.ns.netinputstream.read(netinputstream.java:89)     @ oracle.jdbc.driver.t4csocketinputstreamwrapper.readnextpacket(t4csocketinputstreamwrapper.java:123)     @ oracle.jdbc.driver.t4csocketinputstreamwrapper.read(t4csocketinputstreamwrapper.java:79)     @ oracle.jdbc.driver.t4cmarenginestream.unmarshalub1(t4cmarenginestream.java:426)     @ oracle.jdbc.driver.t4c8ttidty.receive(t4c8ttidty.java:688)     @ oracle.jdbc.driver.t4c8ttidty.dorpc(t4c8ttidty.java:595)     @ oracle.jdbc.driver.t4cconnection.connect(t4cconnection.java:1439)     @ oracle.jdbc.driver.t4cconnection.logon(t4cconnection.java:486)     ... 12 more 

from server's log:

fatal ni connect error 12170.    version information:         tns linux: version 11.2.0.3.0 - production         oracle bequeath nt protocol adapter linux: version 11.2.0.3.0 - production         tcp/ip nt protocol adapter linux: version 11.2.0.3.0 - production   time: 22-apr-2014 09:57:45   tracing not turned on.   tns error struct:     ns main err code: 12535  tns-12535: tns:operation timed out     ns secondary err code: 12606     nt main err code: 0     nt secondary err code: 0     nt os err code: 0   client address: (address=(protocol=tcp)(host=<my.ip.address>)(port=42738)) 

from oracle documentation on both server errors:

ora-12535: tns:operation timed out cause: requested operation not completed within time out period. action: @ documentation on secondary errors possible remedy. see sqlnet.log find secondary error if not provided explicitly. turn on tracing gather more information.  ora-12606: tns: application timeout occurred cause: network session did not reach application-defined stage within allowed time interval. action: error not appear @ high level. action take application specific, , detailed in higher level error description. 

solutions i've tried:

  1. adding following system property -djava.security.egd=file:///dev/urandom suggested in stackoverflow discussion below.
  2. set rng-tools 'help' entropy generator of os. (see links)

  3. following code runs without problem producing random byte arrays (regardless of parameter -djava.security.egd:

int = 10000; while (a-- > 0){ byte[] array = new byte[2048]; new securerandom().nextbytes(array); system.out.println(a); }

none of above seem have changed error (time-out).

edit: new attemps:

  1. running application recognize exact query causes me live problem. when reading clog column of 1-2kb in size.

sql> select secure_params session_token id=11065073; <- query stuck.

restart client,

increasingly updating field in specific row still read field if 429 charactes in size, when i've increased 587 chars got stuck again.

    sql>  select length( secure_params) session_token id=11065073;      length(secure_params)     ---------------------                       587 

sql> select secure_params session_token id=11065073; <- query again stuck.

attemps number 4 brings me thought there might additional issue here, since application able create initial connection , short data db, fails when results-set gets bit fat.

end of edit

links:

stackoverflow: oracle jdbc intermittent connection issue

rng entropy generator: http://www.howtoforge.com/helping-the-random-number-generator-to-gain-enough-entropy-with-rng-tools-debian-lenny

ora-12170 indicates tcp connection database listener failed.

if error happens time, check firewalls , network acls. possibly intermediary has changed?

alternatively, other artifact impacting tcp connectivity, such ip address clash. i've had problem myself, , have blogged @ http://distracted-it.blogspot.co.nz/2014/04/ora-12170-tnsconnect-timeout-resolved.html

hope helps.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -