Teradata JDBC fastload hangs after approximately 50 batch insert

Connectivity
Enthusiast

Teradata JDBC fastload hangs after approximately 50 batch insert

I took the example T20206JD [url=http://www.teradata.com/DownloadCenter/Topic9347-99-1.aspx][/url]
provided by Teradata and slightly modified it.
I increased number of the batches and size of each batch. Each batch has 1000 inserts and I have about 200 batches. See below.

After running for a few iterations the program hangs. Usually it happens after approximately 50 batches. For example here are the last lines from one of the runs

ADDED: Batch 46
Inserting data rows...

Debugger shows that java program waits on socket for Teradata Server response. No warning messages is returned be the previous batchUpdate

Teradata JDBC driver: 12.108
Teratata Server: Windows 12.01.24

[code]
for (int j = 0; j < 209; j++) {
int batchCount = 0;
for (int i = 0; i < 1000; i++) {

pstmt.setInt(1, 1);
pstmt.setString(2, strBuf);
pstmt.addBatch();
batchCount++;

pstmt.setInt(1, 2);
pstmt.setString(2, strBuf);
pstmt.addBatch();
batchCount++;
}
System.out.println(
"ADDED: Batch " + j);
int updateCounts[] = pstmt.executeBatch();
...
}

[/code]

7 REPLIES
Enthusiast

Re: Teradata JDBC fastload hangs after approximately 50 batch insert

Here is the report about locks. Looks the way it should be. These locks appear after the first executeBatch and no additional locks are found after fastload hangs later down the road

---------------- AMP 1 REPORTS 1 LOCK ENTRIES -------------

GRANTED LOCK REQUEST(S):

Tran: 16383 00000964
Host: 2049 Session: 0, 1069 Mode: Ac* User: TESTUSER
Database: TESTUSER

---------------- AMP 0 REPORTS 1 LOCK ENTRIES -------------

GRANTED LOCK REQUEST(S):

Tran: 16383 00000964
Host: 2049 Session: 0, 1069 Mode: Ac* User: TESTUSER
Database: TESTUSER

------------- -------------
Enthusiast

Re: Teradata JDBC fastload hangs after approximately 50 batch insert

Adding additional time delay between executeBatch seems to resolve the problem

try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}

It looks like a serious bug (most probably rush condition) in Teradata RDBMs .

JDBC driver 12.0.0.108
Teradata Server: Windows: 12.01.24

PS. I hope somebody from Teradata technical support is reading this forum and would be able to comment on this issue. If you need any additional info to help you to reproduce the bug I will gladly help.
Teradata Employee

Re: Teradata JDBC fastload hangs after approximately 50 batch insert

Please note that FastLoad cannot load duplicate rows, even into a MULTISET table.

Because the same column values are used on each pass through the loop, your example program will attempt to load thousands of duplicate rows.

Having said that, however, we would not expect the Teradata Database to hang when you attempt to do this.

What Teradata Database configuration is being used? Is this Teradata Express Edition?
Enthusiast

Re: Teradata JDBC fastload hangs after approximately 50 batch insert

Yes, it is Teradata Express Edition
Teradata Employee

Re: Teradata JDBC fastload hangs after approximately 50 batch insert

You can submit a request for support for this issue with Teradata Express, if you haven't done so already.

Go to the Teradata Express page: http://www.teradata.com/express

Then click the link for "Customer Support for the Teradata Express Edition".

Re: Teradata JDBC fastload hangs after approximately 50 batch insert

Hi, How can I bulk insert data with TERADA jdbc driver? I use preparestatament and I use addbatch and executebatch methods?

Teradata Employee

Re: Teradata JDBC fastload hangs after approximately 50 batch insert

Please don't add new questions to old forum threads. Please start a new forum thread instead.

Here is the JDBC Fastload section of the Teradata JDBC Driver Reference: http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_2.html#BABFGFAF

Here is the JDBC Fastload CSV section of the Teradata JDBC Driver Reference: http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_2.html#BABFGFA2

Here are the JDBC sample programs - refer to the samples in Module 2 that use JDBC Fastload: http://developer.teradata.com/doc/connectivity/jdbc/reference/current/samplePrograms.html