java.sql.SQLException: Io exception: Socket read timed out vs Closed Connection -


i trying research issue on following 2 errors connecting oracle dbs:

  1. closed connection
  2. java.sql.sqlexception: io exception: socket read timed out

my understanding:

  1. closed connection : occurring either because there sort of network disruption or db closed session due sort "inactivity"
  2. java.sql.sqlexception: io exception: socket read timed out : case connection made reason socket/data empty , timed-out because no data available.

is possible replicate above errors in local oracle db env ? steps ?

i appreciate taking time respond.

thanks.

your understanding on closed connection right. reason closed connection: external devices such firewall, network devices, , remote database listeners can force network connections close after period of inactivity

readtimeout happen on active connections. if query or procedure taking lot of time, read time out exception.

  • closed connection : shutdown database listener when database running
  • readtimedout : add sleep in procedure more 10 minutes , call procedure application

replication of socket read time out error in oracle db env:

  1. setnetworktimeout sql connection // example sake, set timeout 120 seconds
  2. call database procedure java , sleep in procedure time more setnetworktimeout

    dbms_lock.sleep(125); -- sleeps 125 seconds 

since procedure not returning with-in 120 seconds due 125 seconds sleep, java throw socket read time out in above scenario.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -