We're updating the issue view to help you get more done. 

Incorrect exception translation when using Oracle

Description

When a not-null constraint is broken, Oracle will throw the following exception:
java.sql.SQLException: ORA-01407: cannot update ("STARS_SECURITY"."PRIVILEGE"."NAME") to NULL
with SQLState=72000 and vendorCode = 1407

This reaches SQLStateConversionDelegate, where it wrongly interpreted as a MySQL specific exception; this is the exact code that does the interpretation:

// MySQL Query execution was interrupted
if ( "70100".equals( sqlState ) ||
// Oracle user requested cancel of current operation
"72000".equals( sqlState ) ) {
throw new QueryTimeoutException( message, sqlException, sql );
}

which leads to it being translated to a QueryTimeoutException.

The SQLStateConversionDelegate should could first look at the vendor code to be able to then interpret the SQLState correctly, based on that vendor.

This is also consistent with the Oracle documentation where 72000 is a "SQL execute phase errors":
http://docs.oracle.com/cd/E15817_01/appdev.111/b31228/appd.htm

Environment

Ubuntu Linux 12.04 32 bit, Oracle Database 11g Release 11.2.0.2.0

Status

Assignee

Lukasz Antoniak

Reporter

Eugen Paraschiv

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.1.3

Priority

Major