pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: lareomerlin@gmail.com
Subject: BUG #17313: Exception by opening and closing connection
Date: Fri, 03 Dec 2021 15:33:02 +0000
Message-ID: <17313-126b96cc43774971@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17313
Logged by:          José Antonio Lareo Domínguez
Email address:      lareomerlin@gmail.com
PostgreSQL version: 13.0
Operating system:   Windows Server 2012
Description:        

Hello,

I have the following exception by opening and closing a connection:

AccessViolationException bei
System.Data.Common.UnsafeNativeMethods.SQLDriverConnectW

I tested the code with multiple OS from Microsoft without problems except in
this particular version.

The operation system is up-to-date, and I tried different versions of the
odbc driver without success. By disabling the connection pooling seems to
avoid the error.
The driver that is causing the exception is the ANSI driver, by using the
Unicode driver the code is running fine.

The following code is a simple example  I did to reproduce the error (C#):


========================================================
            string connectionString = "Driver={PostgreSQL};Server=IP
address;Port=5432;Database=myDataBase;Uid=myUsername;Pwd=myPassword";

            while (true)
            {
                using (OdbcConnection conn = new OdbcConnection())
                {
                    Console.WriteLine("Opening connection");
                    conn.ConnectionString = connectionString;
                    conn.Open();
                    Thread.Sleep(100);
                    conn.Close();
                    Console.WriteLine("Closing connection");
                    Thread.Sleep(100);
                }
            }
=========================================

If you need futher information just contact me
Thank you.



Message-ID: <17313-126b96cc43774971@postgresql.org>
Permalink:  ../17313-126b96cc43774971@postgresql.org/
Also on:    postgresql.org/message-id/17313-126b96cc43774971@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, lareomerlin@gmail.com
  Subject: Re: BUG #17313: Exception by opening and closing connection
  In-Reply-To: <17313-126b96cc43774971@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox