All Forums Connectivity
lil-dice 2 posts Joined 02/11
16 Oct 2013
JDBC Bug with exact batch sizes

Noticed this error:
Caused By: com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC] [Error 1382] [SQLState HY000] The batch is empty.
Upon some analysis I found that if the number of rows in the file (say 30) is matching or is multiple of the batch update size (in Topology > Technology > Teradata) value (again 30) then I am getting this error. It seems that that when loading the data in batches odi picks all 30 rows in 1 batch and then goes back to fetch the remaining data. In second batch no rows are returned and I receive this error. I trid the same approach with Oracle and it worked there.
Is this a bug in the Teradata JDBc bug?

tomnolan 594 posts Joined 01/08
17 Oct 2013

No, this is not a bug in the Teradata JDBC Driver.
If an application calls the executeBatch method without having called the addBatch method, then the Teradata JDBC Driver will throw the exception you listed. An application should only call the executeBatch method if the application actually added one or more rows to the batch by calling the addBatch method.
You mentioned "odi". Are you referring to Oracle Data Integrator? If you are experiencing this problem with Oracle Data Integrator, then you should report the problem to Oracle.

lil-dice 2 posts Joined 02/11
18 Oct 2013

Thanks for the info, we were able to get to the bottom of this. Teradata does in fact implement this different than other JDBC providers (oracle). Oracle throws no error at all, anyway the root bug was with groovy's withBatch implementation.
See discussion here:

You must sign in to leave a comment.