WARNING: there is already a transaction in progress

From: Matevž Mrak <matevz(dot)mr(at)gmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: WARNING: there is already a transaction in progress
Date: 2014-07-11 13:38:39
Message-ID: CAF3mAgnJy3O0+q0_AgLp0kVPBYR4FUVkv++c1O=8BXJgsjwLmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Dear support,

I am using these software with your psqlodbc driver:

unixODBC: 2.3.2.
ODBC psqlodbc driver: http://www.postgresql.org/ftp/odbc/versions/src/
(latest) - psqlodbc-09.03.0300.tar.gz
OSX version: 10.9.3
UCS: UCS2
Eclipse: Eclipse Standard/SDK - Kepler Service Release - Build id:
20140224-0627
Python: 2.7.6
mxBase version: egenix-mx-base-3.2.6-py2.7_ucs2-macosx-10.4-fat-prebuilt
mxODBC version: egenix-mxodbc-3.1.2.macosx-10.4-fat-py2.7_ucs2.prebuilt

-----------------

I am getting error *"WARNING: there is already a transaction in progress"*
when trying to execute command "*BEGIN TRANSACTION; LOCK TABLE "%s" IN
EXCLUSIVE MODE;'"*

We have written mutex which is working on other systems to unlock and lock
database table using pgsql-odbc driver. Is that possible that transaction
is ran automatically by driver or when "*cur *=* self.conn.cursor*()" is
executed ? Has anyone else experienced that issue?

-----------------

*Python code:*

def *lock*(*self*)*:*

*"""*

* Engages the lock*

*(at)return:** None*

* """*

* log.info <http://log.info>*(*"**mutex** lock %d"* %*
self.locked*)

if not* self.locked:*

* cur *=* self.conn.cursor*()

* log.info <http://log.info>*(*"**mutex** start **tran**"*)

* self.locked *= True

try*:*

* cur.execute*(*'BEGIN TRANSACTION; LOCK TABLE "%s" IN
EXCLUSIVE MODE;'* %* self.table*)

except*:*

* log.info <http://log.info>*(*"**mutex* *tran** failed"*
)

* log.exception*()

raise

else*:*

* log.info <http://log.info>*(*"**mutex* *tran**
started"*)

* cur.close*()

del* cur*

def *unlock*(*self*)*:*

*"""*

* Releases the lock*

*(at)return:** None*

* """*

* log.info <http://log.info>*(*"**mutex** unlock %d"* %*
self.locked*)

if* self.locked:*

try*:*

* cur *=* self.conn.cursor*()

except*:*

* log.exception*()

raise

* log.info <http://log.info>*(*"**mutex** end **trans**"*)

* self.locked *= False

* cur.execute*(*"END TRANSACTION"*)

* log.info <http://log.info>*(*"**mutex* *trans** ended"*)

* cur.close*()

del* cur*

*Python error: *

InterfaceError: ('25001', -1, 'WARNING: there is already a transaction in
progress', 8489)

- File "/Users/user/ana/ana/srv/orm/driver.py", line 100, in execute

[0m[31m14:58:53.862 0.0.0.0 {unknown} - Query to execute: BEGIN
TRANSACTION; LOCK TABLE "Sys_sequencer" IN EXCLUSIVE MODE; - File
"/Users/user/ana/ana/srv/orm/driver.py", line 101, in execute

*SQL ODBC log: *https://dl.dropboxusercontent.com/u/17952943/sql.log

*SQL ODBC warning in log:*

Statement = 0x100a0fa00
SQL = [BEGIN TRANSACTION; LOCK TABLE "Sys_sequencer" IN EXCLUSIVE
MODE;][length = 64]
[ODBC][20715][1405083533.616254][SQLExecDirect.c][503]
Exit:[SQL_SUCCESS_WITH_INFO]
DIAG [25001] WARNING: there is already a transaction in progress

(BEGIN TRANSACTION; LOCK TABLE "Sys_sequencer" IN EXCLUSIVE MODE; is called
three times one afteranother without unlock)

--
Lep pozdrav,
Matevž Mrak

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Matevž Mrak 2014-07-11 13:42:44 Re: WARNING: there is already a transaction in progress
Previous Message Craig Ringer 2014-07-10 05:23:16 Re: Ask for two questions on psqlodbc