ODBC Calling Fill - Unexptected closed connection after 2 hours

From: David Parenteau <dparenteau(at)axper(dot)com>
To: "pgsql-odbc(at)lists(dot)postgresql(dot)org" <pgsql-odbc(at)lists(dot)postgresql(dot)org>
Subject: ODBC Calling Fill - Unexptected closed connection after 2 hours
Date: 2021-05-10 21:14:27
Message-ID: YQBPR0101MB12994B270FD41153B2FF940CC2549@YQBPR0101MB1299.CANPRD01.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Using PostgreSQL 12.3 (Ubuntu 12.3-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
I use driver PostgresSQL Unicode(x64) version 13.00.00.00

I have a query that is executed through an ODBC connection in a Powershell 5.1 script. I use the Fill() method to retreive about 3500 records daily. When the script works, it takes 2-5 minutes to execute and retrieve data.
Probleme is that the script "fails" half of the time approx. When this occurs, the powershell script does stop only after 2h and 30 seconds.
We double checked the postgres logs and when this occurs, we see that the query successfully completed within 6 minutes always. I don't know what to look for. any Idea?

Below is the error got:

Executed as user: NT Service\SQLSERVERAGENT. A job step received an error at line 94 in a PowerShell script. The corresponding line is '(New-Object system.Data.odbc.odbcDataAdapter($cmd)).fill($ds) | out-null '. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Exception calling "Fill" with "1" argument(s): "The connection has been disabled." '. Process Exit Code -1.

Not too familiar with postgreSQL.

Thanks!

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Inoue,Hiroshi 2021-05-11 23:57:43 Re: PostgreSQL ODBC mylog() uses lots of CPU in INTEGER field SQL query
Previous Message ScheduleReports Monitoring 2021-05-10 16:01:36 ODBC Get-Data using FIll() gets timeout after 2 hours half of the time