I am using CloverETL 3.0.1. I’ve coded a new graph that inserts a record and gets back a generated key. The first attempt at this yields the following exception:
ERROR [InsertPubObject_0] - java.lang.NullPointerException
DEBUG [InsertPubObject_0] - reset thread runId; runId:0 thread name:InsertPubObject_0
ERROR [WatchDog] - Graph execution finished with error
ERROR [WatchDog] - Node InsertPubObject finished with status: ERROR caused by: null caused by: java.lang.NullPointerException
ERROR [WatchDog] - Node InsertPubObject error details:
org.jetel.exception.JetelException: null caused by: java.lang.NullPointerException
at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:664)
at org.jetel.graph.Node.run(Node.java:425)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NullPointerException
at org.jetel.connection.jdbc.AutoKeyGenerator.fieldMap(AutoKeyGenerator.java:216)
at org.jetel.connection.jdbc.AutoKeyGenerator.init(AutoKeyGenerator.java:157)
at org.jetel.connection.jdbc.AutoKeyGenerator.fillKeyRecord(AutoKeyGenerator.java:120)
at org.jetel.connection.jdbc.SQLCloverStatement.fillKeyRecord(SQLCloverStatement.java:664)
at org.jetel.connection.jdbc.SQLCloverStatement.executeUpdate(SQLCloverStatement.java:436)
at org.jetel.component.DBOutputTable.runInNormalMode(DBOutputTable.java:696)
at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:640)
… 2 more
I debugged through this code, and it looks like the fillKeyRecord method is attempting to initialize the input record before actually creating the key record, but it dereferences that key record within the init call (leading to the null pointer exception).
Is there some configuration setting I need to do to set up auto_generated key records correctly?
I am using JDBC-specific MYSQL in the connection.
The insert statement looks like this:
INSERT INTO pub_object (tair_object_id, name, table_name, date_entered, date_updated,
entered_by, updated_by, date_last_synchronized)
VALUES ($tair_object_id, $name, ${table_name}, CURRENT_DATE, CURRENT_DATE, 75, 75, CURRENT_DATE)
RETURNING $id := auto_generated, $tair_object_id := $tair_object_id