All Forums Connectivity
pganelin 8 posts Joined 03/08
17 Apr 2009
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 batchUpdateTeradata JDBC driver: 12.108Teratata 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]

pganelin 8 posts Joined 03/08
20 Apr 2009

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 00000964Host: 2049 Session: 0, 1069 Mode: Ac* User: TESTUSERDatabase: TESTUSER---------------- AMP 0 REPORTS 1 LOCK ENTRIES ------------- GRANTED LOCK REQUEST(S):Tran: 16383 00000964Host: 2049 Session: 0, 1069 Mode: Ac* User: TESTUSERDatabase: TESTUSER------------- -------------

pganelin 8 posts Joined 03/08
20 Apr 2009

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.108Teradata Server: Windows: 12.01.24PS. 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.

tomnolan 594 posts Joined 01/08
22 Apr 2009

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?

pganelin 8 posts Joined 03/08
05 May 2009

Yes, it is Teradata Express Edition

tomnolan 594 posts Joined 01/08
08 May 2009

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/expressThen click the link for "Customer Support for the Teradata Express Edition".

ersin.gulbahar 3 posts Joined 06/13
02 Jul 2013

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

tomnolan 594 posts Joined 01/08
03 Jul 2013

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
 

You must sign in to leave a comment.