Some exceptions in Oracle

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:
<bean destroy-method="close">
<property name="url">
<value> $ (jdbc.url) </ value>
</ Property>
<property name="driverClassName">
<value> $ (jdbc.driver) </ value>
</ Property>
<property name="username">
<value> $ (jdbc.username) </ value>
</ Property>
<property name="password">
<value> $ (jdbc.password) </ value>
</ Property>
<property name="testOnBorrow">
<value> true </ value>
</ Property>
<property name="testOnReturn">
<value> true </ value>
</ Property>
<property name="testWhileIdle">
<value> true </ value>
</ Property>
<property name="minEvictableIdleTimeMillis">
<value> 180000 </ value>
</ Property>
<property name="timeBetweenEvictionRunsMillis">
<value> 360000 </ value>
</ Property>
<property name="validationQuery">
<value> SELECT 1 FROM SYS.DUAL </ value>
</ Property>
<property name="maxActive">
<value> 100 </ value>
</ Property>
</ Bean>
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:

9.0.1 Database
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 [17447]; 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.
--------------------------------------------------

分类:Database 时间:2010-08-14 人气:221
分享到:
blog comments powered by Disqus

相关文章

  • An effect is very nice JAVA database connection pool 2009-08-05

    import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.Enumeration; import java.util.Vector; /* Although the use o

  • A very good effect JAVA Database Connection Pool 2010-07-14

    import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.Enumeration; import java.util.Vector; /* Although the use o

  • JDBC database connection pool Statment 2010-09-08

    1. Foreword   database applications, in many software systems are often used, is indispensable for the development of supporting large-scale systems. But if not well managed database resources (such as: failure to make timely recovery of the databa

  • Java connection pool using the Oracle database connection 2010-10-26

    1.Java four methods of connecting to the database program 1 JDBC-ODBC bridge and ODBC driver - in this way, this is a local solution, because the ODBC driver and the bridge code must appear in each user's machine. Fundamentally, this is a temporary s

  • JDBC database connection pool and the principle of achieving 2010-11-07

    1. Introduction Database applications, in many software systems are often used, is indispensable to the development of supporting large-scale systems. But if not well managed database resources (such as: failure to make timely recovery of the databas

  • A simple implementation of JDBC database connection pool 2011-01-06

    Of :snapbug From :CSDN   directory :   1. Introduction   2. Connection pool technology background   2.1 JDBC   2.2 JDBC Connection Pool   2.3 connection pool (ConnectionPool) And resource management   3. Simple JDBC Implementation of co

  • Comparing Java framework database connection pool (c3p0, dbcp and proxool) 2011-07-16

    Now commonly used open source data connection pool are c3p0, dbcp and proxool three, including: ¨ hibernate team recommends using c3p0; ¨ spring team recommends using dbcp (dbcp connection pool weblogic connection pool has the same problem, is forced

  • Database connection pool - java 2011-06-10

    Java applications access the database of the basic principles of In the Java language, JDBC (Java DataBase Connection) is a database application with a bridge, or the Java language to access the database through JDBC technology. JDBC is an "open"

  • Deeper understanding of database connection pool 2010-07-08

    Although the use of APACHE COMMONS DBCP can be very convenient to establish a database connection pool, but as this article within the principles of database connection pool to write so thorough, so complete attention, is really very rare, so develop

  • JDBC connection pool 2010-08-17

    Introduction In recent years, with the Internet / Intranet networking technology and the rapid development and the rapid worldwide spread, the computer Applications from traditional desktop applications to Web applications. Based on B / S (Browser /

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.409 (s). 12 q(s)