Java.sql.SQLException:Io exception: Got minus one from a read call

Source: Internet
Author: User
Tags oracleconnection sessions tomcat server

Blog Category:
    • Oracle

Application connection under Tomcat server The Oracle times is wrong and the following exception occurs:

Java.sql.SQLException:Io exception: Got minus one from a read call

Querying database connections:

Java code
  1. Sql> Select Username,count (username) from V$session where username are not null GROUP by username;
  2. USERNAME COUNT (USERNAME)
  3. ------------------------------ ---------------
  4. SP2
  5. YWTWEBDB
  6. SYS 2
  7. INFO 1
  8. MF 658
  9. UC 183
  10. 6 rows selected.

Java code
    1. Sql> Select COUNT (*) from v$session where status=' ACTIVE ';
    2. COUNT (*)
    3. ----------
    4. 675

The reason is unclear: the performance is the database connection number is large, the temporary processing is restarts the database, restarts after the resolution, but the estimation is not the final workaround. Connection condition after reboot:

Java code
  1. Number of database connections at normal times:
  2. Sql> Select Username,count (username) from V$session where username are not null GROUP by username;
  3. USERNAME COUNT (USERNAME)
  4. ------------------------------ ---------------
  5. SP2
  6. YWTWEBDB 2
  7. SYS 1
  8. INFO 1
  9. MF
  10. Myjin 1
  11. UC
  12. 7 rows selected.

The following is a collection of online solutions for this issue:

http://www.iteye.com/topic/1126453

Http://blog.sina.com.cn/s/blog_529aacbd0100t22b.html

Http://hi.baidu.com/xjieni/item/1afbff62dab025167cdecc21

Excerpts are as follows:

Java code
  1. It is strange to have the following exception when you accidentally connect to Oracle with Java today:
  2. Caused By:java.sql.SQLException:Io exception: Got minus one from a read call
  3. At Oracle.jdbc.dbaccess.DBError.throwSqlException (Dberror.java:134)
  4. At Oracle.jdbc.dbaccess.DBError.throwSqlException (Dberror.java:179)
  5. At Oracle.jdbc.dbaccess.DBError.throwSqlException (Dberror.java:333)
  6. At Oracle.jdbc.driver.oracleconnection.<init> (oracleconnection.java:404)
  7. At Oracle.jdbc.driver.OracleDriver.getConnectionInstance (Oracledriver.java:468)
  8. At Oracle.jdbc.driver.OracleDriver.connect (Oracledriver.java:314) ....
  9. Issue after restarting the app, an error occurred when the app connected to Oracle failed to start the app.
  10. Finally restart the ORACLE11G service, no problem, but have not found a specific reason.
  11. Later on in another application also found the same problem, found that the severity of the problem, after analysis may be the driving problem, without restarting the ORACLE11G service, replace the latest version of the JDBC driver package, problem resolution;
  12. Ojdbc14.jar version of the problem: (View the MANIFEST.MF file for the jar package)
  13. Manifest-version: 1.0
  14. Specification-title:oracle JDBC driver classes for use with JDK14
  15. Sealed: True
  16. Created-by: 1.4.2_08 (Sun Microsystems Inc.)
  17. Implementation-title:ojdbc14.jar
  18. Specification-vendor:oracle Corporation
  19. Specification-version:oracle JDBC Driver Version- "10.2.0.1.0"
  20. Implementation-version:oracle JDBC Driver Version- "10.2.0.1.0"
  21. Implementation-vendor:oracle Corporation
  22. Implementation-time:wed June: £ 2005
  23. name:oracle/sql/converter/
  24. Sealed: false
  25. name:oracle/sql/
  26. Sealed: false
  27. name:oracle/sql/converter_xcharset/
  28. Sealed: false
  29. Ojdbc14.jar version To resolve the issue:
  30. Manifest-version: 1.0
  31. Specification-title:oracle JDBC driver classes for use with JDK14
  32. Sealed: True
  33. Created-by: 1.4.2_14 (Sun Microsystems Inc.)
  34. Implementation-title:ojdbc14.jar
  35. Specification-vendor:oracle Corporation
  36. Specification-version:oracle JDBC Driver Version- "10.2.0.4.0"
  37. Implementation-version:oracle JDBC Driver Version- "10.2.0.4.0"
  38. Implementation-vendor:oracle Corporation
  39. Implementation-time:sat Feb 2 : £º
  40. name:oracle/sql/converter/
  41. Sealed: false
  42. name:oracle/sql/
  43. Sealed: false
  44. name:oracle/sql/converter_xcharset/
  45. Sealed: false

Java code
    1. caught: java.sql.sqlexception: io  exception: got minus  one from a read call  
    2. when using JDBC to connect to Oracle, the above error occurred several times, and then went to the Internet to find the following basic methods are available:   
    3.   
    4. 1: Database connection is full, expand database connection pool   
    5.   
    6. 2: the IP of the machine is not in the Sqlnet.ora, after the addition of the restart Listerner can   
    7.   
    8. 3: Database load balancer, specified (server=dedicated), remove this can be   
    9.   
    10. 4: The network administrator restricts access to Oracle on the Oracle configuration, which is similar to 2, Also modify the Oracle configuration,   
    11. is looking for a solution, now the database does not belong to my tube, can not restart, expand the connection pool symptoms do not cure, and the database connection pool is written by myself, Blind enlargement can cause many problems for other users to access, preferably by destroying the links created earlier. Alas, this is the disadvantage of code is not standardized AH. When creating connection, you must not forget the close, even if the connection pool do not forget returnconnection ah.   

Java code
  1. Because the database is always normal, it cannot be a configuration-like error.
  2. After the DBA has checked something, the conclusion is that the system is not enough resources.
  3. --View system resources
  4. SELECT Resource_name,
  5. Current_utilization,
  6. Max_utilization,
  7. LIMIT,
  8. ROUND (Max_utilization/limit * 100) | | '% ' rate
  9. From (SELECT resource_name,
  10. Current_utilization,
  11. Max_utilization,
  12. To_number (initial_allocation) LIMIT
  13. From V$resource_limit
  14. WHERE resource_name in (' processes ', ' sessions ')
  15. and Max_utilization > 0);
  16. Resource_name current_utilization max_utilization LIMIT Rate
  17. ------------------------------ ------------------- --------------- ---------- -----
  18. processes                                        312              500         500 100%&NBSP;&NBSP;
  19. Sessions 317 509 555 92%
  20. Discovery is insufficient resources.
  21. The processing methods are:
  22. Alter system set processes=scope=spfile;
  23. Alter system set sessions=1110 scope=spfile; then restart the database
  24. It's just that the values are down after I reboot, and there are other reasons why resources are not enough.

Java.sql.SQLException:Io exception: Got minus one from a read call

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.