Blog Category:
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
- Sql> Select Username,count (username) from V$session where username are not null GROUP by username;
- USERNAME COUNT (USERNAME)
- ------------------------------ ---------------
- SP2
- YWTWEBDB
- SYS 2
- INFO 1
- MF 658
- UC 183
- 6 rows selected.
Java code
- Sql> Select COUNT (*) from v$session where status=' ACTIVE ';
- COUNT (*)
- ----------
- 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
- Number of database connections at normal times:
- Sql> Select Username,count (username) from V$session where username are not null GROUP by username;
- USERNAME COUNT (USERNAME)
- ------------------------------ ---------------
- SP2
- YWTWEBDB 2
- SYS 1
- INFO 1
- MF
- Myjin 1
- UC
- 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
- It is strange to have the following exception when you accidentally connect to Oracle with Java today:
- Caused By:java.sql.SQLException:Io exception: Got minus one from a read call
- At Oracle.jdbc.dbaccess.DBError.throwSqlException (Dberror.java:134)
- At Oracle.jdbc.dbaccess.DBError.throwSqlException (Dberror.java:179)
- At Oracle.jdbc.dbaccess.DBError.throwSqlException (Dberror.java:333)
- At Oracle.jdbc.driver.oracleconnection.<init> (oracleconnection.java:404)
- At Oracle.jdbc.driver.OracleDriver.getConnectionInstance (Oracledriver.java:468)
- At Oracle.jdbc.driver.OracleDriver.connect (Oracledriver.java:314) ....
- Issue after restarting the app, an error occurred when the app connected to Oracle failed to start the app.
- Finally restart the ORACLE11G service, no problem, but have not found a specific reason.
- 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;
- Ojdbc14.jar version of the problem: (View the MANIFEST.MF file for the jar package)
- Manifest-version: 1.0
- Specification-title:oracle JDBC driver classes for use with JDK14
- Sealed: True
- Created-by: 1.4.2_08 (Sun Microsystems Inc.)
- Implementation-title:ojdbc14.jar
- Specification-vendor:oracle Corporation
- Specification-version:oracle JDBC Driver Version- "10.2.0.1.0"
- Implementation-version:oracle JDBC Driver Version- "10.2.0.1.0"
- Implementation-vendor:oracle Corporation
- Implementation-time:wed June: £ 2005
- name:oracle/sql/converter/
- Sealed: false
- name:oracle/sql/
- Sealed: false
- name:oracle/sql/converter_xcharset/
- Sealed: false
- Ojdbc14.jar version To resolve the issue:
- Manifest-version: 1.0
- Specification-title:oracle JDBC driver classes for use with JDK14
- Sealed: True
- Created-by: 1.4.2_14 (Sun Microsystems Inc.)
- Implementation-title:ojdbc14.jar
- Specification-vendor:oracle Corporation
- Specification-version:oracle JDBC Driver Version- "10.2.0.4.0"
- Implementation-version:oracle JDBC Driver Version- "10.2.0.4.0"
- Implementation-vendor:oracle Corporation
- Implementation-time:sat Feb 2 : £º
- name:oracle/sql/converter/
- Sealed: false
- name:oracle/sql/
- Sealed: false
- name:oracle/sql/converter_xcharset/
- Sealed: false
Java code
- caught: java.sql.sqlexception: io exception: got minus one from a read call
- 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:
-
- 1: Database connection is full, expand database connection pool
-
- 2: the IP of the machine is not in the Sqlnet.ora, after the addition of the restart Listerner can
-
- 3: Database load balancer, specified (server=dedicated), remove this can be
-
- 4: The network administrator restricts access to Oracle on the Oracle configuration, which is similar to 2, Also modify the Oracle configuration,
- 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
- Because the database is always normal, it cannot be a configuration-like error.
- After the DBA has checked something, the conclusion is that the system is not enough resources.
- --View system resources
- SELECT Resource_name,
- Current_utilization,
- Max_utilization,
- LIMIT,
- ROUND (Max_utilization/limit * 100) | | '% ' rate
- From (SELECT resource_name,
- Current_utilization,
- Max_utilization,
- To_number (initial_allocation) LIMIT
- From V$resource_limit
- WHERE resource_name in (' processes ', ' sessions ')
- and Max_utilization > 0);
- Resource_name current_utilization max_utilization LIMIT Rate
- ------------------------------ ------------------- --------------- ---------- -----
- processes 312 500 500 100%&NBSP;&NBSP;
- Sessions 317 509 555 92%
- Discovery is insufficient resources.
- The processing methods are:
- Alter system set processes=scope=spfile;
- Alter system set sessions=1110 scope=spfile; then restart the database
- 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