java.sql.SQLException: Error In Specifying Automatically (Server) Generated Keys.

Hibernate JIRA | Andrew from Poland | 1 decade ago
  1. 0

    When there is an column of SERIAL or SERIAL8 type (identity types in Informix) database expect this column to appear in INSERT clause with value equal 0, for example: INSERT into my_table (my_serial_column, other_column) values (0, "some value"); - in this example my_serial_column is an identity column. Using current InformixDialect this insert looks like this: INSERT into my_table (other_column) values ( "some value"); which causes an exception: java.sql.SQLException: Error In Specifying Automatically (Server) Generated Keys. at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373) at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208) at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518) at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353) at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269) at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153) at com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318) at com.informix.jdbc.IfxPreparedStatement.a(IfxPreparedStatement.java:298) at com.informix.jdbc.IfxPreparedStatement.<init>(IfxPreparedStatement.java:275) at com.informix.jdbc.IfxSqliConnect.prepareStatement(IfxSqliConnect.java:2077) at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:418) at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:385) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:40) at $Proxy10.prepareStatement(Unknown Source) ... I've tested a solution - dialect must redefine getIdentityInsertString method like this: public String getIdentityInsertString() { return "0"; } After that identity column appear in INSERT clause with value set to 0. I'am using hibernate version 3.1.3, but in the latest build 3.2.0.cr4 problem still exist (i've downloaded it and checked InformixDialect.java file).

    Hibernate JIRA | 1 decade ago | Andrew from Poland
    java.sql.SQLException: Error In Specifying Automatically (Server) Generated Keys.
  2. 0

    When there is an column of SERIAL or SERIAL8 type (identity types in Informix) database expect this column to appear in INSERT clause with value equal 0, for example: INSERT into my_table (my_serial_column, other_column) values (0, "some value"); - in this example my_serial_column is an identity column. Using current InformixDialect this insert looks like this: INSERT into my_table (other_column) values ( "some value"); which causes an exception: java.sql.SQLException: Error In Specifying Automatically (Server) Generated Keys. at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373) at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208) at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518) at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353) at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269) at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153) at com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318) at com.informix.jdbc.IfxPreparedStatement.a(IfxPreparedStatement.java:298) at com.informix.jdbc.IfxPreparedStatement.<init>(IfxPreparedStatement.java:275) at com.informix.jdbc.IfxSqliConnect.prepareStatement(IfxSqliConnect.java:2077) at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:418) at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:385) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:40) at $Proxy10.prepareStatement(Unknown Source) ... I've tested a solution - dialect must redefine getIdentityInsertString method like this: public String getIdentityInsertString() { return "0"; } After that identity column appear in INSERT clause with value set to 0. I'am using hibernate version 3.1.3, but in the latest build 3.2.0.cr4 problem still exist (i've downloaded it and checked InformixDialect.java file).

    Hibernate JIRA | 1 decade ago | Andrew from Poland
    java.sql.SQLException: Error In Specifying Automatically (Server) Generated Keys.
  3. 0

    informx jdbc: System or internal error

    Google Groups | 1 decade ago | david chan
    java.sql.SQLException: System or internal error
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Tomcat Connection Pooling problem

    Coderanch | 1 decade ago | Insia ahmad
    java.sql.SQLException: System or internal error
  6. 0

    Memory Leaks in Embedded Jetty during load testing

    Stack Overflow | 4 years ago | GRIM
    java.sql.SQLException: Memory allocation failed during query processing.

    9 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLException

      Error In Specifying Automatically (Server) Generated Keys.

      at com.informix.util.IfxErrMsg.getSQLException()
    2. com.informix.util
      IfxErrMsg.getSQLException
      1. com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
      1 frame
    3. com.informix.jdbc
      IfxSqliConnect.prepareStatement
      1. com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
      2. com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
      3. com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
      4. com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
      5. com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153)
      6. com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318)
      7. com.informix.jdbc.IfxPreparedStatement.a(IfxPreparedStatement.java:298)
      8. com.informix.jdbc.IfxPreparedStatement.<init>(IfxPreparedStatement.java:275)
      9. com.informix.jdbc.IfxSqliConnect.prepareStatement(IfxSqliConnect.java:2077)
      9 frames
    4. Commons DBCP
      PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement
      1. org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:418)
      2. org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:385)
      2 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    6. Hibernate
      BorrowedConnectionProxy.invoke
      1. org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:40)
      1 frame
    7. Unknown
      $Proxy10.prepareStatement
      1. $Proxy10.prepareStatement(Unknown Source)
      1 frame