<?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: [resolved] Multiple Sub Jobs in the Same Transaction in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317888#M88276</link>
    <description>No one know how to help me?</description>
    <pubDate>Sun, 10 Jul 2011 11:29:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-07-10T11:29:08Z</dc:date>
    <item>
      <title>[resolved] Multiple Sub Jobs in the Same Transaction</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317887#M88275</link>
      <description>Hi, 
&lt;BR /&gt;I'm trying to use TOS 4.2.2 to migrate some tables from mssql to postgresql. 
&lt;BR /&gt;I'm using simple JDBC components to do this. I also need to disable foreign key constraints in postgres during the transaction. 
&lt;BR /&gt;I built a father to do this (see Screenshot-1.png): 
&lt;BR /&gt;- It opens connections to the two dbs and registers each as a shared connection (see Screenshot-3.png) with auto commit disabled to do everything under the same transaction (see Screenshot-2.png). 
&lt;BR /&gt;- Runs a tJDBCRow component to disable all constraints check until end of transaction (see Screenshot.png). 
&lt;BR /&gt;- Then runs child job (see Screenshot-5.png) that: 
&lt;BR /&gt; - Opens connections to the two dbs using the registered connection with auto commit disabled (see Screenshot-3.png). 
&lt;BR /&gt; - Migrates the tables. 
&lt;BR /&gt;- If there is an error in any of the child processes it should roll back and close the connections, otherwise it commits and closes the connections. 
&lt;BR /&gt;I'm getting an error about foreign keys violation even though I've run the tJDBCRow. An example is pasted below. 
&lt;BR /&gt;I assume this is because the sub jobs for some reason are not under the same big transaction. How do I get to do everything under the same flow so I can get rid of the errors? 
&lt;BR /&gt; 
&lt;BR /&gt;example of exception: 
&lt;BR /&gt;Starting job MigrationTool at 14:26 07/07/2011. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; connecting to socket on port 3518 
&lt;BR /&gt; connected 
&lt;BR /&gt;Exception in component tJDBCOutput_134 
&lt;BR /&gt;org.postgresql.util.PSQLException: ERROR: update or delete on table "image_templates" violates foreign key constraint "image_map" on table "sample_image_map" 
&lt;BR /&gt; Detail: Key (it_guid)=(00000000-0000-0000-0000-000000000000) is still referenced from table "help_image_map". 
&lt;BR /&gt; at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) 
&lt;BR /&gt; at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) 
&lt;BR /&gt; at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) 
&lt;BR /&gt; at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) 
&lt;BR /&gt; at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) 
&lt;BR /&gt; at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:299) 
&lt;BR /&gt; at migration_tool.copytables_0_1.CopyTables.tJDBCInput_120Process(CopyTables.java:47772) 
&lt;BR /&gt; at migration_tool.copytables_0_1.CopyTables.runJobInTOS(CopyTables.java:48977) 
&lt;BR /&gt; at migration_tool.copytables_0_1.CopyTables.runJob(CopyTables.java:48129) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.tRunJob_1Process(MigrationTool.java:1021) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.tJDBCRow_1Process(MigrationTool.java:885) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.tJDBCConnection_1Process(MigrationTool.java:775) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.tJDBCConnection_2Process(MigrationTool.java:668) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.runJobInTOS(MigrationTool.java:1884) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.main(MigrationTool.java:1661) 
&lt;BR /&gt; 
&lt;BR /&gt;!!Here goes lots of more exceptions!! 
&lt;BR /&gt;Exception in component tRunJob_1 
&lt;BR /&gt;java.lang.RuntimeException: Child job running failed 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.tRunJob_1Process(MigrationTool.java:1039) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.tJDBCRow_1Process(MigrationTool.java:885) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.tJDBCConnection_1Process(MigrationTool.java:775) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.tJDBCConnection_2Process(MigrationTool.java:668) 
&lt;BR /&gt; disconnected 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.runJobInTOS(MigrationTool.java:1884) 
&lt;BR /&gt; at migration_tool.migrationtool_1_0.MigrationTool.main(MigrationTool.java:1661) 
&lt;BR /&gt;Job MigrationTool ended at 14:26 07/07/2011.</description>
      <pubDate>Sat, 16 Nov 2024 12:49:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317887#M88275</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Multiple Sub Jobs in the Same Transaction</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317888#M88276</link>
      <description>No one know how to help me?</description>
      <pubDate>Sun, 10 Jul 2011 11:29:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317888#M88276</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-10T11:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Multiple Sub Jobs in the Same Transaction</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317889#M88277</link>
      <description>Hi 
&lt;BR /&gt;You want all the sub jobs to be executed multi thread execution? I see you put all sub jobs in child job without any connector. 
&lt;BR /&gt;Maybe you can move the tJDBCRow to child job, eg: 
&lt;BR /&gt;tJDBCConnection_1 
&lt;BR /&gt; | 
&lt;BR /&gt;onsubjobok 
&lt;BR /&gt; | 
&lt;BR /&gt;tJDBCConnection_2 
&lt;BR /&gt; | 
&lt;BR /&gt;onsubjobok 
&lt;BR /&gt; | 
&lt;BR /&gt;tJDBCRow 
&lt;BR /&gt; | 
&lt;BR /&gt;onsubjobok 
&lt;BR /&gt; | 
&lt;BR /&gt;tJDBCInput--main--tJDBCOutput 
&lt;BR /&gt; ... 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 11 Jul 2011 12:55:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317889#M88277</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-11T12:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Multiple Sub Jobs in the Same Transaction</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317890#M88278</link>
      <description>Yes, I want a multi thread execution, if possible.&lt;BR /&gt;I tried to add connectors and the tJDBCRow and both failed.&lt;BR /&gt;&lt;BR /&gt;Yaniv</description>
      <pubDate>Mon, 11 Jul 2011 13:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317890#M88278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-11T13:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Multiple Sub Jobs in the Same Transaction</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317891#M88279</link>
      <description>Hi, 
&lt;BR /&gt;I solved this issue. First there is a bug in the code generation that although I uncheck auto-commit the connection autocommit setting was true so I had to to add the code:
&lt;BR /&gt;
&lt;PRE&gt;conn_tJDBCConnection_1.setAutoCommit(false);&lt;/PRE&gt;
&lt;BR /&gt;that caused all the sub jobs to run under the same transaction. I opened a bug on this in this link: 
&lt;A href="http://www.talendforge.org/bugs/view.php?id=23244" rel="nofollow noopener noreferrer"&gt;http://www.talendforge.org/bugs/view.php?id=23244&lt;/A&gt;.
&lt;BR /&gt;Second I had to disable all foreign key during the session and I did that by entering:
&lt;BR /&gt;
&lt;PRE&gt;SET session_replication_role to 'replica';&lt;/PRE&gt;
&lt;BR /&gt;In postgres foreign key are implemented as triggers, so this line cause all triggers which are not defined as replica or checked always to be disabled.
&lt;BR /&gt;In most cases this does the trick.
&lt;BR /&gt;Hope this will help someone else.</description>
      <pubDate>Wed, 13 Jul 2011 16:29:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317891#M88279</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-13T16:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Multiple Sub Jobs in the Same Transaction</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317892#M88280</link>
      <description>I used tJDBCRow to enter the pl/pgsql to disable foreign keys.</description>
      <pubDate>Wed, 13 Jul 2011 16:30:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317892#M88280</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-13T16:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Multiple Sub Jobs in the Same Transaction</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317893#M88281</link>
      <description>Hi 
&lt;BR /&gt;Glad to see that you find out the problem by yourself, cool! 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; Thanks for your workaround and reporting! 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Thu, 14 Jul 2011 04:21:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Multiple-Sub-Jobs-in-the-Same-Transaction/m-p/2317893#M88281</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-14T04:21:33Z</dc:date>
    </item>
  </channel>
</rss>

