<?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: How to disable AutoCommit in Postgresql data source? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-disable-AutoCommit-in-Postgresql-data-source/m-p/2197547#M1250</link>
    <description>OPS4J PAX JDBC documentation has issues....it says config file should use "ka." prefix for defaultAutoCommit, however, it should be "factory." 
&lt;BR /&gt;After I correct config file as below, data source can be created 
&lt;BR /&gt; 
&lt;PRE&gt;osgi.jdbc.driver.class=org.postgresql.Driver-pool-xa&lt;BR /&gt;serverName=192.168.100.121&lt;BR /&gt;databaseName=MobileCRM&lt;BR /&gt;portNumber=5432&lt;BR /&gt;user=mobilecrmuser&lt;BR /&gt;password=*******&lt;BR /&gt;dataSourceName=MobileCRMDS&lt;BR /&gt;pool.maxIdle=5&lt;BR /&gt;pool.maxTotal=10&lt;BR /&gt;pool.minIdle=2&lt;BR /&gt;factory.defaultAutoCommit=false&lt;/PRE&gt; 
&lt;BR /&gt;&amp;nbsp;however i still get same autoCommit is enabled exception. 
&lt;BR /&gt; 
&lt;PRE&gt;karaf@trun()&amp;gt; Exception in component tPostgresqlCommit_1&lt;BR /&gt;org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled.&lt;BR /&gt;        at org.postgresql.jdbc2.AbstractJdbc2Connection.commit(AbstractJdbc2Connection.java:811)&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Feb 2016 15:21:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-02-22T15:21:18Z</dc:date>
    <item>
      <title>How to disable AutoCommit in Postgresql data source?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-disable-AutoCommit-in-Postgresql-data-source/m-p/2197546#M1249</link>
      <description>Hi , 
&lt;BR /&gt;I am using TOS 6.0 and facing an issue on Postgresql autocommit.&amp;nbsp; 
&lt;BR /&gt;I have setup a postgresql data source via PAX JDBC&amp;nbsp;in Karaf and configuration file is: 
&lt;BR /&gt; 
&lt;PRE&gt;osgi.jdbc.driver.class=org.postgresql.Driver-pool-xa&lt;BR /&gt;serverName=192.168.100.121&lt;BR /&gt;databaseName=MobileCRM&lt;BR /&gt;portNumber=5432&lt;BR /&gt;user=*******&lt;BR /&gt;password=*******&lt;BR /&gt;dataSourceName=MobileCRMDS&lt;BR /&gt;pool.maxIdle=5&lt;BR /&gt;pool.maxTotal=10&lt;BR /&gt;pool.minIdle=2&lt;/PRE&gt; 
&lt;BR /&gt;And in my Talend Job, I have tPostgresqlConnection to use this data source with "Auto Commit" unselected.&amp;nbsp; 
&lt;BR /&gt;However, after tPostgresqlOutput successfully inserts records, tPostgresqlCommit throw an exception: 
&lt;BR /&gt; 
&lt;PRE&gt;karaf@trun()&amp;gt; Exception in component tPostgresqlCommit_1&lt;BR /&gt;org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled.&lt;BR /&gt;        at org.postgresql.jdbc2.AbstractJdbc2Connection.commit(AbstractJdbc2Connection.java:811)&lt;BR /&gt;        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;I tried to add xa.defaultAutoCommit to data source config file, but JDBC (org.postgresql.jdbc41:9.4.0.build-1200) failed to recognize this parameter with below exception: 
&lt;BR /&gt; 
&lt;PRE&gt;18:28:42,339 | ERROR | f8-fcc56774aa6a) | ds.DbcpXAPooledDataSourceFactory   85 | 317 - org.ops4j.pax.jdbc.pool.dbcp2 - 0.7.0 | Error creating pooled datasourceUnsupported property name: xa.defaultAutoCommit&lt;BR /&gt;org.postgresql.util.PSQLException: Unsupported property name: xa.defaultAutoCommit&lt;BR /&gt;	at org.postgresql.ds.common.BaseDataSource.setProperty(BaseDataSource.java:993)&lt;BR /&gt;	at org.postgresql.osgi.PGDataSourceFactory.configureBaseDataSource(PGDataSourceFactory.java:90)&lt;BR /&gt;	at org.postgresql.osgi.PGDataSourceFactory.createXADataSource(PGDataSourceFactory.java:167)&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Nov 2024 10:47:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-disable-AutoCommit-in-Postgresql-data-source/m-p/2197546#M1249</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to disable AutoCommit in Postgresql data source?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-disable-AutoCommit-in-Postgresql-data-source/m-p/2197547#M1250</link>
      <description>OPS4J PAX JDBC documentation has issues....it says config file should use "ka." prefix for defaultAutoCommit, however, it should be "factory." 
&lt;BR /&gt;After I correct config file as below, data source can be created 
&lt;BR /&gt; 
&lt;PRE&gt;osgi.jdbc.driver.class=org.postgresql.Driver-pool-xa&lt;BR /&gt;serverName=192.168.100.121&lt;BR /&gt;databaseName=MobileCRM&lt;BR /&gt;portNumber=5432&lt;BR /&gt;user=mobilecrmuser&lt;BR /&gt;password=*******&lt;BR /&gt;dataSourceName=MobileCRMDS&lt;BR /&gt;pool.maxIdle=5&lt;BR /&gt;pool.maxTotal=10&lt;BR /&gt;pool.minIdle=2&lt;BR /&gt;factory.defaultAutoCommit=false&lt;/PRE&gt; 
&lt;BR /&gt;&amp;nbsp;however i still get same autoCommit is enabled exception. 
&lt;BR /&gt; 
&lt;PRE&gt;karaf@trun()&amp;gt; Exception in component tPostgresqlCommit_1&lt;BR /&gt;org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled.&lt;BR /&gt;        at org.postgresql.jdbc2.AbstractJdbc2Connection.commit(AbstractJdbc2Connection.java:811)&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 15:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-disable-AutoCommit-in-Postgresql-data-source/m-p/2197547#M1250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-22T15:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to disable AutoCommit in Postgresql data source?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-disable-AutoCommit-in-Postgresql-data-source/m-p/2197548#M1251</link>
      <description>I believe this is a bug in TOS 6.0 now. 
&lt;BR /&gt;Here is a part of codes from tPostgresqlConnection: 
&lt;BR /&gt; 
&lt;PRE&gt;				java.sql.Connection conn_tPostgresqlConnection_1 = null;&lt;BR /&gt;				if ((null == globalMap.get(KEY_DB_DATASOURCES))&lt;BR /&gt;						|| "".equals("MobileCRMDS")) {&lt;BR /&gt;					String driverClass_tPostgresqlConnection_1 = "org.postgresql.Driver";&lt;BR /&gt;					java.lang.Class&lt;BR /&gt;							.forName(driverClass_tPostgresqlConnection_1);&lt;BR /&gt;					conn_tPostgresqlConnection_1 = java.sql.DriverManager&lt;BR /&gt;							.getConnection(url_tPostgresqlConnection_1,&lt;BR /&gt;									dbUser_tPostgresqlConnection_1,&lt;BR /&gt;									dbPwd_tPostgresqlConnection_1);&lt;BR /&gt;					globalMap.put("conn_tPostgresqlConnection_1",&lt;BR /&gt;							conn_tPostgresqlConnection_1);&lt;BR /&gt;				}&lt;BR /&gt;				if (null != conn_tPostgresqlConnection_1) {&lt;BR /&gt;					conn_tPostgresqlConnection_1.setAutoCommit(false);&lt;BR /&gt;				}&lt;BR /&gt;				globalMap.put("schema_" + "tPostgresqlConnection_1",&lt;BR /&gt;						(String) globalMap.get("DBSchema"));&lt;BR /&gt;				globalMap.put("conn_" + "tPostgresqlConnection_1",&lt;BR /&gt;						conn_tPostgresqlConnection_1);&lt;/PRE&gt; 
&lt;BR /&gt;We can find this component does not create connection when there's a valid data source, therefore, other tPostgresql****&amp;nbsp;component&amp;nbsp;will try to&amp;nbsp;obtain a new connection from matched data source in globalMap, so we will lose control on transaction because each DB component might using different DB connections.&amp;nbsp; 
&lt;BR /&gt;I raised one issue in Jira&amp;nbsp; 
&lt;A href="https://jira.talendforge.org/browse/TESB-17097" target="_blank" rel="nofollow noopener noreferrer"&gt;TESB-17097&lt;/A&gt;</description>
      <pubDate>Tue, 23 Feb 2016 07:02:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-disable-AutoCommit-in-Postgresql-data-source/m-p/2197548#M1251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-23T07:02:37Z</dc:date>
    </item>
  </channel>
</rss>

