Spring Data JDBC: DataRetrievalFailureException : Unable to cast [oracle.sql.ROWID] to [java.lang.Number]

前端 未结 3 1523
悲哀的现实
悲哀的现实 2021-01-22 14:10

I am new to Spring Data JDBC, and I am struggling to create a simple Dto and get it persisted on the DB.

I am using Spring-Boot 2.1.1.RELEASE and and Oracle 12 Database.

3条回答
  •  再見小時候
    2021-01-22 14:55

    Unfortunately, Oracle is not yet fully supported. There is an issue open for creating integration tests for Oracle and the accompanying PR is already fixing some issues, but certainly not all.

    The main problem here is that Oracle does some interesting stuff regarding generated key generation. I see the following options

    a) Don't use key generation on the database side. DATAJDBC-282 makes this more comfortable. But it is so far only in the SNAPSHOT release.

    b) Don't use Oracle. We currently test with MySql, Postgres, H2, HSQLDB and MariaDb

    c) Take a look at the PR mentioned above to see if you can patch it enough to work.

    I'm aware that these options aren't very satisfying. The challenge is that it is really hard for an Open Source project to do integration tests with Oracle, since even downloading a legal Oracle JDBC driver from a public CI build is a nightmare, let alone a database.

    A coworker sent me this image when we were discussing the situation:

    But we don't give up, proper support will be added.

提交回复
热议问题