org.pentaho.di.core.exception.KettleDatabaseException: Unable to retrieve value of auto-generated technical key : unexpected error: Unable to retrieve key(s) from auto-increment field(s) Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().

Pentaho BI Platform Tracking | jrox | 5 years ago
  1. 0

    The dimension lookup/update step in a transformation throws an exception when the transformation is run for a second time from JAVA. I can't figure out why the exception is being thrown at the second run, am I supposed to close something when the first run has completed? When running the transformation in Spoon (n-times) it works just fine so obviously I'm missing something in my code. The lookup is set to create the technical key using an auto increment field in MySQL. Code: KettleEnvironment.init(); TransMeta transMeta = new TransMeta("file.ktr"); trans = new Trans(transMeta); trans.execute(new String[0]); trans.waitUntilFinished(); Result result = trans.getResult(); StackTrace: ERROR 30-08 12:28:45,079 - Dimension lookup/update - Because of an error this step can't continue: Unable to retrieve value of auto-generated technical key : unexpected error: Unable to retrieve key(s) from auto-increment field(s) Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement(). ERROR 30-08 12:28:45,079 - Dimension lookup/update - org.pentaho.di.core.exception.KettleDatabaseException: Unable to retrieve value of auto-generated technical key : unexpected error: Unable to retrieve key(s) from auto-increment field(s) Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement(). at org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.dimInsert(DimensionLookup.java:1090) at org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.lookupValues(DimensionLookup.java:647) at org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.processRow(DimensionLookup.java:221) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40) at java.lang.Thread.run(Thread.java:662) Caused by: org.pentaho.di.core.exception.KettleDatabaseException: Unable to retrieve key(s) from auto-increment field(s) Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement(). at org.pentaho.di.core.database.Database.getGeneratedKeys(Database.java:1190) at org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.dimInsert(DimensionLookup.java:1083) ... 4 more Caused by: java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement(). at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) at com.mysql.jdbc.StatementImpl.getGeneratedKeys(StatementImpl.java:1923) at org.pentaho.di.core.database.Database.getGeneratedKeys(Database.java:1173) ... 5 more More information (including ROWLEVEL log) can be found on the forum: http://forums.pentaho.com/showthread.php?83729-Dimension-lookup-update-generated-keys-problem

    Pentaho BI Platform Tracking | 5 years ago | jrox
    org.pentaho.di.core.exception.KettleDatabaseException: Unable to retrieve value of auto-generated technical key : unexpected error: Unable to retrieve key(s) from auto-increment field(s) Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
  2. 0

    The dimension lookup/update step in a transformation throws an exception when the transformation is run for a second time from JAVA. I can't figure out why the exception is being thrown at the second run, am I supposed to close something when the first run has completed? When running the transformation in Spoon (n-times) it works just fine so obviously I'm missing something in my code. The lookup is set to create the technical key using an auto increment field in MySQL. Code: KettleEnvironment.init(); TransMeta transMeta = new TransMeta("file.ktr"); trans = new Trans(transMeta); trans.execute(new String[0]); trans.waitUntilFinished(); Result result = trans.getResult(); StackTrace: ERROR 30-08 12:28:45,079 - Dimension lookup/update - Because of an error this step can't continue: Unable to retrieve value of auto-generated technical key : unexpected error: Unable to retrieve key(s) from auto-increment field(s) Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement(). ERROR 30-08 12:28:45,079 - Dimension lookup/update - org.pentaho.di.core.exception.KettleDatabaseException: Unable to retrieve value of auto-generated technical key : unexpected error: Unable to retrieve key(s) from auto-increment field(s) Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement(). at org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.dimInsert(DimensionLookup.java:1090) at org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.lookupValues(DimensionLookup.java:647) at org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.processRow(DimensionLookup.java:221) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40) at java.lang.Thread.run(Thread.java:662) Caused by: org.pentaho.di.core.exception.KettleDatabaseException: Unable to retrieve key(s) from auto-increment field(s) Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement(). at org.pentaho.di.core.database.Database.getGeneratedKeys(Database.java:1190) at org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.dimInsert(DimensionLookup.java:1083) ... 4 more Caused by: java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement(). at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) at com.mysql.jdbc.StatementImpl.getGeneratedKeys(StatementImpl.java:1923) at org.pentaho.di.core.database.Database.getGeneratedKeys(Database.java:1173) ... 5 more More information (including ROWLEVEL log) can be found on the forum: http://forums.pentaho.com/showthread.php?83729-Dimension-lookup-update-generated-keys-problem

    Pentaho BI Platform Tracking | 5 years ago | jrox
    org.pentaho.di.core.exception.KettleDatabaseException: Unable to retrieve value of auto-generated technical key : unexpected error: Unable to retrieve key(s) from auto-increment field(s) Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
  3. 0

    MySQL Bugs: #72270: SQLException Generated keys not requested on INSERT

    mysql.com | 2 years ago
    java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.sql.SQLException: Generated keys not requested. in JBoss

    Stack Overflow | 1 year ago | mahendra kawde
    java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
  6. 0

    Notification on Create Users

    Google Groups | 3 years ago | Augusto C├ęsar Dias
    java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().

    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

      Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().

      at com.mysql.jdbc.SQLError.createSQLException()
    2. MySQL jdbc
      StatementImpl.getGeneratedKeys
      1. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
      2. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
      3. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
      4. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
      5. com.mysql.jdbc.StatementImpl.getGeneratedKeys(StatementImpl.java:1923)
      5 frames
    3. org.pentaho.di
      RunThread.run
      1. org.pentaho.di.core.database.Database.getGeneratedKeys(Database.java:1173)
      2. org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.dimInsert(DimensionLookup.java:1083)
      3. org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.lookupValues(DimensionLookup.java:647)
      4. org.pentaho.di.trans.steps.dimensionlookup.DimensionLookup.processRow(DimensionLookup.java:221)
      5. org.pentaho.di.trans.step.RunThread.run(RunThread.java:40)
      5 frames
    4. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:662)
      1 frame