Re: ADO CommandTimeout vs Postgres statement_timeout parameter - Mailing list pgsql-odbc

From Tsunakawa, Takayuki
Subject Re: ADO CommandTimeout vs Postgres statement_timeout parameter
Date
Msg-id 0A3221C70F24FB45833433255569204D1F57AAE6@G01JPEXMBYT05
Whole thread Raw
In response to ADO CommandTimeout vs Postgres statement_timeout parameter  (Richard Hetherington <hetheringtonrichard@hotmail.com>)
Responses Re: ADO CommandTimeout vs Postgres statement_timeout parameter
List pgsql-odbc

Hello, Richard, Inoue-san,

 

Richard, please post to pgsql-odbc ML as much as possible, because I’d like Inoue-san to have a look.  He is currently the only committer of psqlODBC, and I’m still an apprentice.

 

I implemented SQL_QUERY_TIMEOUT, which seems to work.  Please find the attached patch.

 

Inoue-san,

At first, I used CC_send_settings() to execute “SET statement_timeout” and refactored it.  After that, I realized I can use CC_send_query() and used it instead.  However, I’d like the refactored code to be applied too.

 

 

Regards

Takayuki Tsunakawa

 

From: Richard Hetherington [mailto:hetheringtonrichard@hotmail.com]
Sent: Friday, May 20, 2016 7:09 PM
To: Tsunakawa, Takayuki/
綱川 貴之
Subject: RE: [ODBC] ADO CommandTimeout vs Postgres statement_timeout parameter

 

Many thanks for you advice. I realised after receiving your email that I had made a fundamental error - I was logging from a website to my desktop folder which clearly isn't going to be writable by a Web Identity Account - oops.

Attached are 2 log files which I have cleaned up to remove all UID, PWD, Server values etc.

You should see that I set the SQL_QUERY_TIMEOUT via the ADO CommandTimeout = 60 seconds

This value has been logged but has no effect on the long running query.
[7212-0.181]SetStmtOption: SQL_QUERY_TIMEOUT, vParam = 60

I hope this is useful.

If you need anything esle, let me know.

Many thanks and have a good weekend,

RICHARD


From: tsunakawa.takay@jp.fujitsu.com
To: hetheringtonrichard@hotmail.com
Subject: RE: [ODBC] ADO CommandTimeout vs Postgres statement_timeout parameter
Date: Fri, 20 May 2016 02:39:30 +0000

Hello,

 

If SQL_QUERY_TIMEOUT is set on the connection or statement, mylog_xxx.log will have entries like this:

 

[140168204601088]PGAPI_SetConnectAttr for 0x8d5360: 0 0xa

[140168204601088]PGAPI_SetConnectOption: entering fOption = 0 vParam = 10

[140168204601088]SetStmtOption: SQL_QUERY_TIMEOUT, vParam = 10

...

[140168204601088][[SQLSetStmtAttr]] Handle=0x8e2110 0,10

[140168204601088]PGAPI_SetStmtAttr Handle=0x8e2110 0,10(0xa)

[140168204601088]PGAPI_SetStmtOption: entering...

[140168204601088]SetStmtOption: SQL_QUERY_TIMEOUT, vParam = 10

 

I'm not sure about the cause of your logging failure, but perhaps you will be able to log to another directory by creating the following registry value:

 

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\<your ODBC driver name>\Logdir

type: REG_SZ

value: directory path

 

Regards

Takayuki Tsunakawa

 

Attachment

pgsql-odbc by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: [patch] fix buffer overrun in logging, and code cleanup
Next
From: "Inoue, Hiroshi"
Date:
Subject: Re: [patch] fix buffer overrun in logging, and code cleanup