Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aWNin-0002WD-SQ for pgsql-odbc@arkaria.postgresql.org; Thu, 18 Feb 2016 12:30:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aWNin-0003Lc-F9 for pgsql-odbc@arkaria.postgresql.org; Thu, 18 Feb 2016 12:30:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aWNiQ-0002jd-DY for pgsql-odbc@postgresql.org; Thu, 18 Feb 2016 12:29:50 +0000 Received: from mail2.asahi-net.or.jp ([202.224.39.198]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aWNi9-0005X9-P8 for pgsql-odbc@postgresql.org; Thu, 18 Feb 2016 12:29:50 +0000 Received: from [192.168.1.3] (h216161.dynamic.ppp.asahi-net.or.jp [61.114.216.161]) by mail2.asahi-net.or.jp (Postfix) with ESMTP id 6327A65F4; Thu, 18 Feb 2016 21:29:22 +0900 (JST) Subject: Re: PostgreSQL: Autocommit through windows odbc driver doesnt work!!! To: "Venkatesan, Sekhar" , "Tsunakawa, Takayuki" References: <56AA5348.60100@commandprompt.com> <56ABD9CF.7030400@aklaver.com> <0A3221C70F24FB45833433255569204D1F521518@G01JPEXMBYT05> <0A3221C70F24FB45833433255569204D1F521579@G01JPEXMBYT05> Cc: Adrian Klaver , "Joshua D. Drake" , "pgsql-odbc@postgresql.org" , "Rao, Raghavendra" From: "Inoue, Hiroshi" Message-ID: <56C5B925.6060608@dream.email.ne.jp> Date: Thu, 18 Feb 2016 21:29:25 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------070802010707010102080502" X-Pg-Spam-Score: -2.6 (--) 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 This is a multi-part message in MIME format. --------------070802010707010102080502 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Hi, It's not the difference between Windows and Linux. There is an option *Level of rollback on errors* to specify either nop, transaction or statement. regards, Hiroshi Inoue On 2016/02/18 15:45, Venkatesan, Sekhar wrote: > > Hi Takayuki, > > One thing I wanted to point out is that I didn’t see this issue in > Linux OS. The application code is the same for both windows and Linux. > In both the cases, we are in a transaction and an error occurred. > > In linux, inserts are getting committed. In Windows, inserts are not > getting committed. I will fix the application code to resolve the > error. But just want to know the reason for different behavior. > > When I enabled tracing in both, I see this difference: > > Windows (After insert statements in tables): > > *2016-02-17 16:47:10 GMT ERROR: relation "dm_job_request_s" does not > exist at character 24* > > 2016-02-17 16:47:10 GMT STATEMENT: SELECT 1 AS total FROM > dm_job_request_s S, dm_job_request_r R WHERE S.r_object_id = > R.r_object_id AND arguments_keys = 'OldUserName' and arguments_values > = $1 AND request_completed = 0 AND job_name = 'dm_UserRename' > > *2016-02-17 16:47:10 GMT LOG: statement: ROLLBACK* > > 2016-02-17 16:47:10 GMT LOG: statement: BEGIN > > Linux (After insert statements in tables): > > *< 2016-02-18 01:17:53.173 EST >ERROR: relation "dm_job_request_s" > does not exist at character 24* > > < 2016-02-18 01:17:53.173 EST >STATEMENT: SELECT 1 AS total FROM > dm_job_request_s S, dm_job_request_r R WHERE S.r_object_id = > R.r_object_id AND arguments_keys = 'OldUserName' and arguments_values > = $1 AND request_completed = 0 AND job_name = 'dm_UserRename' > > *< 2016-02-18 01:17:53.173 EST >LOG: statement: ROLLBACK to > _EXEC_SVP_0x35fa4b0* > > *< 2016-02-18 01:17:53.173 EST >LOG: statement: RELEASE > _EXEC_SVP_0x35fa4b0* > > ** > > In linux, there is one extra call to release the savepoint which is > not the case in windows. > > Is this causing the behavior change in windows when compared to linux? > > What is the expected behavior when “Release” savepoint is called? > > *Note:* In linux, we are talking to linux PostgreSQL server. In > Windows, We are talking to windows PostgreSQL server. > > Thanks, > Sekhar > > --------------070802010707010102080502 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit Hi,

It's not the difference between Windows and Linux.
There is an option *Level of rollback on errors* to specify either nop, transaction or statement.

regards,
Hiroshi Inoue

On 2016/02/18 15:45, Venkatesan, Sekhar wrote:

Hi Takayuki,

 

One thing I wanted to point out is that I didn’t see this issue in Linux OS. The application code is the same for both windows and Linux. In both the cases, we are in a transaction and an error occurred.

In linux, inserts are getting committed. In Windows, inserts are not getting committed. I will fix the application code to resolve the error. But just want to know the reason for different behavior.

When I enabled tracing in both, I see this difference:

 

Windows (After insert statements in tables):

2016-02-17 16:47:10 GMT ERROR:  relation "dm_job_request_s" does not exist at character 24

2016-02-17 16:47:10 GMT STATEMENT:  SELECT 1 AS total FROM dm_job_request_s S, dm_job_request_r R WHERE S.r_object_id = R.r_object_id AND arguments_keys = 'OldUserName' and arguments_values = $1   AND request_completed = 0 AND job_name = 'dm_UserRename'

2016-02-17 16:47:10 GMT LOG:  statement: ROLLBACK

2016-02-17 16:47:10 GMT LOG:  statement: BEGIN



 

Linux (After insert statements in tables):

< 2016-02-18 01:17:53.173 EST >ERROR:  relation "dm_job_request_s" does not exist at character 24

< 2016-02-18 01:17:53.173 EST >STATEMENT:  SELECT 1 AS total FROM dm_job_request_s S, dm_job_request_r R WHERE S.r_object_id = R.r_object_id AND arguments_keys = 'OldUserName' and arguments_values = $1   AND request_completed = 0 AND job_name = 'dm_UserRename'

< 2016-02-18 01:17:53.173 EST >LOG:  statement: ROLLBACK to _EXEC_SVP_0x35fa4b0

< 2016-02-18 01:17:53.173 EST >LOG:  statement: RELEASE _EXEC_SVP_0x35fa4b0

 

In linux, there is one extra call to release the savepoint which is not the case in windows.

Is this causing the behavior change in windows when compared to linux?

What is the expected behavior when “Release” savepoint is called?

 

Note: In linux, we are talking to linux PostgreSQL server. In Windows, We are talking to windows PostgreSQL server.

 

Thanks,
Sekhar



--------------070802010707010102080502--