Skip to content

setQueryTimeout not works when bulk copy to Azure Data Warehouse #803

@tilumi

Description

@tilumi

Driver version

7.0.0.jre8

SQL Server version

Azure SQL Data Warehouse Gen1

Client Operating System

Ubuntu

JAVA/JVM version

1.8

Problem description

  1. I use the method mention here: https://github.com/Microsoft/mssql-jdbc/wiki/How-to-enable-Bulk-Copy-API-for-batch-insert-operations to bulk copy data to Data Warehouse

  2. I use insertStatement.setQueryTimeout(10 * 60) to set timeout.

  3. I don't specify timeout properties on connection string.

  4. Expected behaviour: Timeout exception will be thrown after 10 mins

  5. Actual behaviour:
    Timeout exception thrown only after 1 min, like this:
    screenshot 2018-09-18 14 59 14

  6. Error message/stack trace:

2018-09-18 06:54:33 Executor task launch worker for task 486 ERROR Executor:91 - Exception in task 162.0 in stage 9.0 (TID 486)
java.sql.BatchUpdateException: The query has timed out.
	at com.shaded.com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2022)
	at com.microsoft.antispam.outputWriters.SQLDataWarehouseWriter$$anonfun$5$$anonfun$apply$1$$anonfun$6.apply(SQLDataWarehouseWriter.scala:89)
	at com.microsoft.antispam.outputWriters.SQLDataWarehouseWriter$$anonfun$5$$anonfun$apply$1$$anonfun$6.apply(SQLDataWarehouseWriter.scala:89)
	at scala.util.Try$.apply(Try.scala:192)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions