<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: tDB2Output autocommit in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373681#M136377</link>
    <description>As usual, I answer my own question. This should becomea JIRA issue as it affects (I think) every type of DB connection : 
&lt;BR /&gt;...\TOS-All-r33000-V3.2.2\workspace\.JETEmitters\src\org\talend\designer\codegen\translators\databases\db2\TDB2ConnectionBeginJava.java 
&lt;BR /&gt;line 250 
&lt;BR /&gt; 
&lt;PRE&gt;    stringBuffer.append(TEXT_39);&lt;BR /&gt;    stringBuffer.append(cid);&lt;BR /&gt;    stringBuffer.append(TEXT_40);&lt;BR /&gt;    stringBuffer.append(setAutoCommit);&lt;BR /&gt;    stringBuffer.append(TEXT_41);&lt;/PRE&gt; 
&lt;BR /&gt;has to be replaced to chan ge the flag only if needed 
&lt;BR /&gt; 
&lt;PRE&gt;//GDU : no setAutocommit(xx)    if not needed (already xx)&lt;BR /&gt;stringBuffer.append(NL);&lt;BR /&gt;stringBuffer.append("//no setAutocommit if not needed (e.g. : already false + setAutocommit(false) ==&amp;gt; commits the changes and re-set the flag (J2SE)");&lt;BR /&gt;stringBuffer.append(NL);&lt;BR /&gt;stringBuffer.append("if (conn_" + cid + ".getAutoCommit() != " + (setAutoCommit?"true":"false") + "){" + NL);&lt;BR /&gt;stringBuffer.append(TEXT_39);&lt;BR /&gt;stringBuffer.append(cid);&lt;BR /&gt;stringBuffer.append(TEXT_40);&lt;BR /&gt;stringBuffer.append(setAutoCommit);&lt;BR /&gt;stringBuffer.append(TEXT_41);&lt;BR /&gt;stringBuffer.append("\t}");&lt;BR /&gt;stringBuffer.append(NL);&lt;BR /&gt;//end of changes&lt;/PRE&gt; 
&lt;BR /&gt;The transaction then works like acharm accross 25 child jobs 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Thu, 10 Dec 2009 09:36:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-12-10T09:36:46Z</dc:date>
    <item>
      <title>tDB2Output autocommit</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373677#M136373</link>
      <description>Hello, 
&lt;BR /&gt;I have a big parent job that initiates a DB2 connection for the output, with the option 'Use or register a shared DB Connection'. 
&lt;BR /&gt;The child jobs use the same connection (also checked the 'Use or....' option), and autocommit == false (unchecked). 
&lt;BR /&gt;The aim is to have a big transaction. 
&lt;BR /&gt;Each child job uses that connection with a tDB2_Output. 
&lt;BR /&gt;Even if I get an error, all the data that has been transferred by the child jobs that already run, is committed... (there is a big tDB2_rollback if any error, in the parent job). 
&lt;BR /&gt;Cause : each tDB2_Output closes its preparedStatement at the end of the job. This causes a flush (commit).... 
&lt;BR /&gt;Bug or per se? 
&lt;BR /&gt;Cheers, 
&lt;BR /&gt; 
&lt;BR /&gt;==&amp;gt; the answer (for JIRA?) : in the tDB2Output_begin.javajet : 
&lt;BR /&gt; 
&lt;PRE&gt;conn_&amp;lt;%=cid%&amp;gt;.setAutoCommit(false);&lt;/PRE&gt; 
&lt;BR /&gt;==&amp;gt; Java documentation : when autocommit() is called, an automatic commit is made before changing this 'flag' 
&lt;BR /&gt;==&amp;gt; I change the javaet on my machine to first check : if already false, I do nothing... 
&lt;BR /&gt;Please raise a JIRA issue 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Sat, 16 Nov 2024 13:39:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373677#M136373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: tDB2Output autocommit</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373678#M136374</link>
      <description>In fact, you don't find this in the doc, but you need to watch the J2SE code (5 &amp;amp; 6) of the Connection object&lt;BR /&gt;&lt;A href="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html&lt;/A&gt;</description>
      <pubDate>Wed, 09 Dec 2009 12:20:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373678#M136374</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-09T12:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: tDB2Output autocommit</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373679#M136375</link>
      <description>Here I am again... 
&lt;BR /&gt;The code that sets the autocommit is in the section 
&lt;BR /&gt;/** 
&lt;BR /&gt; * start 
&lt;BR /&gt;*/ 
&lt;BR /&gt;...of the generated code. 
&lt;BR /&gt;Where is it stated? 
&lt;BR /&gt;Appearently, this is a common feature for connections, but I don't find chere to change this.... (not in the connection javajet...). 
&lt;BR /&gt;Please, tell me</description>
      <pubDate>Wed, 09 Dec 2009 12:29:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373679#M136375</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-09T12:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: tDB2Output autocommit</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373680#M136376</link>
      <description>( deleted -- see next post)</description>
      <pubDate>Wed, 09 Dec 2009 13:20:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373680#M136376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-09T13:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: tDB2Output autocommit</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373681#M136377</link>
      <description>As usual, I answer my own question. This should becomea JIRA issue as it affects (I think) every type of DB connection : 
&lt;BR /&gt;...\TOS-All-r33000-V3.2.2\workspace\.JETEmitters\src\org\talend\designer\codegen\translators\databases\db2\TDB2ConnectionBeginJava.java 
&lt;BR /&gt;line 250 
&lt;BR /&gt; 
&lt;PRE&gt;    stringBuffer.append(TEXT_39);&lt;BR /&gt;    stringBuffer.append(cid);&lt;BR /&gt;    stringBuffer.append(TEXT_40);&lt;BR /&gt;    stringBuffer.append(setAutoCommit);&lt;BR /&gt;    stringBuffer.append(TEXT_41);&lt;/PRE&gt; 
&lt;BR /&gt;has to be replaced to chan ge the flag only if needed 
&lt;BR /&gt; 
&lt;PRE&gt;//GDU : no setAutocommit(xx)    if not needed (already xx)&lt;BR /&gt;stringBuffer.append(NL);&lt;BR /&gt;stringBuffer.append("//no setAutocommit if not needed (e.g. : already false + setAutocommit(false) ==&amp;gt; commits the changes and re-set the flag (J2SE)");&lt;BR /&gt;stringBuffer.append(NL);&lt;BR /&gt;stringBuffer.append("if (conn_" + cid + ".getAutoCommit() != " + (setAutoCommit?"true":"false") + "){" + NL);&lt;BR /&gt;stringBuffer.append(TEXT_39);&lt;BR /&gt;stringBuffer.append(cid);&lt;BR /&gt;stringBuffer.append(TEXT_40);&lt;BR /&gt;stringBuffer.append(setAutoCommit);&lt;BR /&gt;stringBuffer.append(TEXT_41);&lt;BR /&gt;stringBuffer.append("\t}");&lt;BR /&gt;stringBuffer.append(NL);&lt;BR /&gt;//end of changes&lt;/PRE&gt; 
&lt;BR /&gt;The transaction then works like acharm accross 25 child jobs 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Thu, 10 Dec 2009 09:36:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373681#M136377</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-10T09:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: tDB2Output autocommit</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373682#M136378</link>
      <description>see bug &lt;A href="http://www.talendforge.org/bugs/view.php?id=10571" rel="nofollow noopener noreferrer"&gt;http://www.talendforge.org/bugs/view.php?id=10571&lt;/A&gt;</description>
      <pubDate>Thu, 10 Dec 2009 09:57:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDB2Output-autocommit/m-p/2373682#M136378</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-10T09:57:58Z</dc:date>
    </item>
  </channel>
</rss>

