JDBC Bug with exact batch sizes

Connectivity

JDBC Bug with exact batch sizes

Noticed this error:

 

Caused By: com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.00.00.05] [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?

Tags (1)
2 REPLIES
Teradata Employee

Re: JDBC Bug with exact batch sizes

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.

Re: JDBC Bug with exact batch sizes

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:

https://jira.codehaus.org/browse/GROOVY-4798