Skip to content

Regression: Insert statement fails with inconsistent datatypes on Oracle 12c driver [SPR-14191] #18764

Closed
@spring-projects-issues

Description

@spring-projects-issues

Jurriaan Mous opened SPR-14191 and commented

We get an inconsistent datatypes exception when we upgraded from Spring 4.2.4 to 4.2.5 on an alike statement:

insert into table_name (id,  timestamp_field, clob_field, number_field, date_field, another_number_field) 
          values(:id, current_timestamp, :clob_value, :number_value, :date_value, :another_number)

It works ok if we move the timestamp to the end of the insert. (We chose in the end to downgrade)

(...)
Caused by: java.lang.reflect.UndeclaredThrowableException: null
       at com.sun.proxy.$Proxy203.executeUpdate(Unknown Source)
       at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:873)
       at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:866)
       at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
       at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:866)
       at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:890)
       at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:287)
      (.....)
Caused by: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected DATE got NUMBER
       at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
       at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
       at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059)
       at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)
       at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)
       at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587)
       at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:225)
       at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:53)
       at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:943)
       at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150)
       at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4798)
       at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:4875)
       at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1361)
       at org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport$StatementProxy.invoke(AbstractQueryReport.java:235)

We are using the Oracle Database 12c Release 1 (12.1.0.1) JDBC Driver.


Affects: 4.2.5

Attachments:

Issue Links:

Referenced from: commits 52447ef, 2adbfb6

Backported to: 4.2.8

0 votes, 5 watchers

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: backportedAn issue that has been backported to maintenance branchestype: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions