Gotchas With Oracle Jdbc Driver
1 - java.sql.SQLException: Preferences ケ ッ Suites 読 み か ら ー タ yu む video game, こ れ は あ Ri ma せ ん above (java.sql.SQLException: No more data to read from socket)
Driver Version: 9i .* or 10g .*
The exception is usually caused by using a connection pool, as obtained from the connection pool when the connection failure or timeout, use this connection to carry out database operations will be over thrown exception.
The solution is to make the database connection pool in the connection before you return to check whether the connnection timeout or failure, if it is, then evict the connection, and returns an available connection.
To DBCP, for example, make the following configuration can solve the problem:
<value> $ (jdbc.url) </ value>
<value> $ (jdbc.driver) </ value>
<value> $ (jdbc.username) </ value>
<value> $ (jdbc.password) </ value>
<value> true </ value>
<value> true </ value>
<value> true </ value>
<value> 180000 </ value>
<value> 360000 </ value>
<value> SELECT 1 FROM SYS.DUAL </ value>
<value> 100 </ value>
In addition, you can look at here: http://www.websina.com/bugzero/errors/oracle-SQLException.html
Reposted elsewhere: Oracle SQLException: No more data to read from socket
java.sql.SQLException: No more data to read from socket at oracle.jdbc.dbaccess.DBError.throwSqlException (DBError.java: 134)
at oracle.jdbc.dbaccess.DBError.throwSqlException (DBError.java: 179)
at oracle.jdbc.dbaccess.DBError.check_error (DBError.java: 1160)
at oracle.jdbc.ttc7.MAREngine.unmarshalUB1 (MAREngine.java: 963)
at oracle.jdbc.ttc7.MAREngine.unmarshalSB1 (MAREngine.java: 893)
at oracle.jdbc.ttc7.Oall7.receive (Oall7.java: 375)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7 (TTC7Protocol.java: 1894)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch (TTC7Protocol.java: 1094)
at oracle.jdbc.driver.OracleStatement.executeNonQuery (OracleStatement.java: 2132)
at oracle.jdbc.driver.OracleStatement.doExecuteOther (OracleStatement.java: 2015)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (OracleStatement.java: 2877)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate (OraclePreparedStatement.java: 608)
This error most likely occurs in applications that use a database connections pool. When the application checked out a connection that has been timed out or has been staled, and used it to connect to the database, this error occurs.
You may need start your Oracle database server as well as your Java application. In a better designed system, however, the staled connection should be cleared out and a new connection should be establised automatically.
2-ORA-17004: Invalid column type (java.sql.SQLException: Invalid column の で type ga desu.) Driver Version: 9i .*
The anomaly first appears in the use of spring + iBatis the program, then an error by checking the fields and SQLMAP reference documents, only to find the problem lies.
If you are using iBatis, that from his SqlMap reference documentation should find the following words, when you see them, you will find the door key to success, Oh
Note! Most drivers only need the type specified for nullable columns. Therefore, for such drivers you only
need to specify the type for the columns that are nullable.
Note! When using an Oracle driver, you will get an "Invalid column type" error if you attempt to set a null
value to a column without specifying its type.
That is, when a column allows null, and you should pass the parameter for null column values when the driver for oracle, this exception is indispensable.
Solution through iBatis the parameterMap, designated parameter elements jdbcType and nullValue to solve; If you do not use iBatis, you can check the parameters of the corresponding as if he can be empty, but the current value is empty when exactly for him to set a value is not empty can.
3-java.sql.SQLException: OALL8 contradictory state に あ Ri し ta ma si; (java.sql.SQLException: OALL8 is in an inconsistent state.)
The exception in our program that usually occurs after the first exception occurs, but not entirely, the exception searched Wang Shang could not find a satisfactory explanation, Only the following information may be used Yi Xie (from http://forums.oracle .com / forums / thread.jspa? messageID = 1275383):
This is known to occur under when you are using too big an array size. How big your array can be depends on the length of each record and the Driver / Database combination. If you exceed the maximum size you will get the "OALL8" SQLException and your connection object may become unusable.
This message is also created if you are using the following:
10.1.0 JDBC Driver
Generated Code that passes in an ARRAY or VARRAY of VARCHAR2 as a Parameter
Or (from http://opensource.atlassian.com/projects/spring/browse/SPR-1545?decorator=none&view=rss):
[SPR-1545] Oracle error 17447 should result in a DataAccessResourceFailureException
Oracle error 17447 is currently an unmapped exception but it should be a DataAccessResourceFailureException. This error occurs when a JDBC connection has become corrupted, usually because of failure to properly close a connection before returning the connection to the connection pool. Here is the error message:
SQL state [null]; error code ; OALL8 is in an inconsistent state; nested exception is java.sql.SQLException: OALL8 is in an inconsistent state
java.sql.SQLException: OALL8 is in an inconsistent state
This is a kind of "oh crap, something bad happened and it's not really your fault" exception in Oracle. A few causes of this message are suggested in my searches on Google, including (see http://forums.oracle.com/ forums / thread.jspa? threadID = 274018 & tstart = 0):
- Use of Oracle 10g JDBC drivers to connect to Oracle 9 databases
- Using too big an array size (9.0.1 Database, 10.1.0 JDBC Driver and Generated Code that passes in an ARRAY or VARRAY of VARCHAR2 as a Parameter)
In any case, after this exception is thrown the connection is corrupted and unusable, hence why I advocate this exception be mapped to a DataAccessResourceFailureException
Solution, I do not know, huh, huh, anyway, after adjusting the first question, this exception no longer occurs in our program.