Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aPGdS-0001Ue-Pj for pgsql-odbc@arkaria.postgresql.org; Fri, 29 Jan 2016 21:31:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aPGdS-0004xn-CM for pgsql-odbc@arkaria.postgresql.org; Fri, 29 Jan 2016 21:31:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aPGd5-0004Xd-LN for pgsql-odbc@postgresql.org; Fri, 29 Jan 2016 21:30:55 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aPGd2-00040s-MJ for pgsql-odbc@postgresql.org; Fri, 29 Jan 2016 21:30:54 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id BB3D920A20 for ; Fri, 29 Jan 2016 16:30:51 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Fri, 29 Jan 2016 16:30:51 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=YneAgBYOLQ3EP47LxHjQ7SYMtSo=; b=kGlWo6 wnS3kUn/9AokwDWYodhUS7OCKtH6xCFlfKcxBvbKioHwxPqQ6caPuXOaFle+IMZ2 4O2K6YJ4lkeasxQpKW8xJTURXjV4HHYyExcMe9RVRxs8msj5IDjK2WTjevFLhtIY +Ue1zVKvAHCnbE/sf2YIcCYK9D9ZF/y9xD8rI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=YneAgBYOLQ3EP47 LxHjQ7SYMtSo=; b=UlEi9kdK26JfMpG6pzBH6LofvDm5EALbc7BF2NZ7dT/uiEb nyiKyZkbGt/zPH5mJWvq2caz9NFxMCch6p1x7W6TyEL5spo0Rv3FAffV9iBGfg8q lY8RY7XtF1D/HaigHJ91cMzgk3Zp0MBanLk09R6cjzMbQzSXbNXBKv1BuSZ0= X-Sasl-enc: rfB9yXI6vDKbAeKH7vm7z1CRr2Nq9ToDAwoK8OpNspRe 1454103051 Received: from [192.168.1.2] (65-102-182-223.tukw.qwest.net [65.102.182.223]) by mail.messagingengine.com (Postfix) with ESMTPA id BBBAEC00012; Fri, 29 Jan 2016 16:30:50 -0500 (EST) Subject: Re: PostgreSQL: Autocommit through windows odbc driver doesnt work!!! To: "Venkatesan, Sekhar" , "Joshua D. Drake" , "pgsql-odbc@postgresql.org" References: <56AA5348.60100@commandprompt.com> From: Adrian Klaver Message-ID: <56ABD9CF.7030400@aklaver.com> Date: Fri, 29 Jan 2016 13:29:51 -0800 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 01/28/2016 08:36 PM, Venkatesan, Sekhar wrote: > HI Joshua, > > I perform the following set of operations to set autocommit in postgreSQL through ODBC in windows. > SQLSetConnectAttr(hDbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER) SQL_AUTOCOMMIT_ON, 0) > > ret = SQLDriverConnect(_hdbc, NULL, (SQLCHAR*) dsn.GetChars(), SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT); > > This doesn't enable autocommit. If I call SQLSetConnectAttr after SQLDriverConnect, autocommit is set. > Any issue with this sequence? I assume It should be possible to set SQL_ATTR_AUTOCOMMIT before establishing connection. > Can you please confirm on this behavior? I would say it is this bug: http://www.postgresql.org/message-id/55BD0ABE.5010800@iki.fi So have you tried the latest psqlodbc version, 09.05.0100 ? > > Thanks, > Sekhar > > -----Original Message----- > From: Joshua D. Drake [mailto:jd@commandprompt.com] > Sent: Thursday, January 28, 2016 11:14 PM > To: Venkatesan, Sekhar; pgsql-odbc@postgresql.org > Subject: Re: [ODBC] PostgreSQL: Autocommit through windows odbc driver doesnt work!!! > > On 01/28/2016 08:53 AM, Venkatesan, Sekhar wrote: > >> Is the above issue fixed? Also in my use-case, I want to enable >> autocommit at odbc driver level but even that doesn't work. >> >> The same application works in Linux OS when unix odbc driver is used. >> This seems to be specific to windows driver. >> >> Please shed some light on this. Do ask me further question if you have any. >> > > By default PostgreSQL "autocommits". If it isn't in your case, your driver is starting a transaction and not committing it. > > Sincerely, > > JD > > > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc