Closed case-k-git closed 3 years ago
Hello, @case-k-git
I'm not an SQLServer user. Have you ever tried the following configuration? It seems that this configuration works the same. Could you tell me the detail of why do you need to add this option?
in:
type: sqlserver
options:
queryTimeout: 5
# ...
Hello @hiroyuki-sato
thank you for your check.
Have you ever tried the following configuration?
I see ... I did not notice that options . I gonna use it . but could you please wait until I finish to check? I have tried to use queryTimeout options. but did not timeout as I expected both options one and my fixed one.
Could you tell me the detail of why do you need to add this option?
I would like to avoid keep executing unintentional query not to press sqlserver database disk. in our company we are using snapshot separation to avoid with(nolock) query data lost and data duplicate issue. with(nolock) query can avoid blocking risk but cause data lost and duplicate issue. so we decided to use snapshot separation not to use with(nolock) query and not to cause query blocking risk. please check the detail under the tech blog about snapshot separation https://techblog.zozo.com/entry/sqlserver-transaction-isolation-level-snapshot
by using snapshot separation the commit record gonna write into the tempdb. SELECT query gonna read record from tempdb. if unintentional query is keep executed, tempdb disk gonna press and cause disk issue.
to avoid the risk of this we wanna set the query timeout option not to keep executing unintentional query
thank you
Hello, @case-k-git
This is just in my(as a this plugin user) opinion,
For example, I used some MySQL-specific JDBC options in the embulk-input-mysql plugin. I think you can use the same option in the embulk-input-sqlserver plugin. So, please try it. If the option doesn't work correctly, It needs to fix the problem at first.
in:
type: mysql
# mysql
options: { useLegacyDatetimeCode: false, serverTimezone: "Pacific/Midway", noTimezoneConversionForDateType: false }
You can check the JDBC option in the logs like the below.
in:
type: mysql
options:
hoge: HOGE
fuga: FUGA
2021-08-25 17:41:15.154 +0900 [INFO] (0001:transaction): Connecting to jdbc:mysql://localhost:3306/embulk_test options {useCompression=true, socketTimeout=1800000, useSSL=false, user=root, useLegacyDatetimeCode=false, tcpKeepAlive=true, hoge=HOGE, fuga=FUGA, useCursorFetch=true, connectTimeout=300000, password=***, zeroDateTimeBehavior=convertToNull}
And If this plugin supports the new query_timeout
option, I hope that embulk-output-sqlsever also supports the same option.(If this option is useful for an output plugin.)
Hello, @case-k-git
I can't test Microsoft SQLServer, but I confirmed the embulk-input-sqlserver plugin(0.12.3) supports the options
parameter.
in:
type: sqlserver
# sqlserver options
options:
hoge: HOGE
fuga: FUGA
queryTimeout: -1
It outputs the following log. It contains queryTimeout
.
So, I think you can set a time query timeout.
2021-08-27 13:19:37.833 +0900 [INFO] (0001:transaction): \
Connecting to jdbc:sqlserver://localhost:1433 options {
socketTimeout=1800000,
user=root,
databaseName=embulk_test,
hoge=HOGE,
fuga=FUGA,
applicationName=embulk-input-sqlserver,
password=***,
loginTimeout=300,
queryTimeout=-1} # <-- HERE
@hiroyuki-sato
Hi thank you for your check
yes I can set the options but did not timeout even if using large amout of data and set short time of query timeout. I have tested both options one and this pr fixed one and both of them not working(not time out). as long as I check the document it should be work.
anyway I gone close this pr .
thank you for helping me
add query timeout options . to avoid executing unintentional query
https://docs.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?redirectedfrom=MSDN&view=sql-server-ver15
tmp.yml
this option is not supported under the drivers
SQL Server jTDS properties http://jtds.sourceforge.net/faq.html
MySQL JDBC https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-connp-props-connection-authentication.html
PostgresSQL JDBC https://jdbc.postgresql.org/documentation/head/connect.html