You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Jarek Jarcec Cecho (JIRA)" <ji...@apache.org> on 2013/01/23 18:37:12 UTC

[jira] [Created] (SQOOP-843) Sqoop2: Generic JDBC connector is committing transaction on export with autoCommit on

Jarek Jarcec Cecho created SQOOP-843:
----------------------------------------

             Summary: Sqoop2: Generic JDBC connector is committing transaction on export with autoCommit on
                 Key: SQOOP-843
                 URL: https://issues.apache.org/jira/browse/SQOOP-843
             Project: Sqoop
          Issue Type: Bug
    Affects Versions: 1.99.1
            Reporter: Jarek Jarcec Cecho
            Assignee: Jarek Jarcec Cecho
             Fix For: 1.99.2


I've noticed that Generic JDBC Connector is not explicitly setting autoCommit and yet is committing transactions. This might lead to issues with for example MySQL JDBC driver that sets the autoCommit to true by default and calling commit will result in following exception being thrown:

{code}
2013-01-23 09:05:02,316 ERROR org.apache.sqoop.job.mr.SqoopOutputFormatLoadExecutor: Error while loading data out of MR job.
org.apache.sqoop.common.SqoopException: GENERIC_JDBC_CONNECTOR_0002:Unable to execute the SQL statement
	at org.apache.sqoop.connector.jdbc.GenericJdbcExecutor.executeBatch(GenericJdbcExecutor.java:106)
	at org.apache.sqoop.connector.jdbc.GenericJdbcExportLoader.load(GenericJdbcExportLoader.java:66)
	at org.apache.sqoop.connector.jdbc.GenericJdbcExportLoader.load(GenericJdbcExportLoader.java:26)
	at org.apache.sqoop.job.mr.SqoopOutputFormatLoadExecutor$ConsumerThread.run(SqoopOutputFormatLoadExecutor.java:212)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.SQLException: Can't call commit when autocommit=true
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:923)
	at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1683)
	at org.apache.sqoop.connector.jdbc.GenericJdbcExecutor.executeBatch(GenericJdbcExecutor.java:103)
	... 9 more
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira