X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 78649538A8 for ; Sat, 26 Mar 2005 09:54:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01565-04 for ; Sat, 26 Mar 2005 09:54:44 +0000 (GMT) Received: from fep06-app.kolumbus.fi (fep06-0.kolumbus.fi [193.229.0.57]) by svr1.postgresql.org (Postfix) with ESMTP id B7467538A7 for ; Sat, 26 Mar 2005 09:54:42 +0000 (GMT) Received: from [192.168.1.3] (really [80.186.80.234]) by fep06-app.kolumbus.fi with ESMTP id <20050326095443.LRJE525.fep06-app.kolumbus.fi@[192.168.1.3]> for ; Sat, 26 Mar 2005 11:54:43 +0200 Message-ID: <42453163.6060508@kolumbus.fi> Date: Sat, 26 Mar 2005 11:54:43 +0200 From: Marko Ristola User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: "'pgsql-odbc@postgresql.org'" Subject: Transactions and savepoints Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.237 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/96 X-Sequence-Number: 5114 Hello. I have been thinking about savepoints. What do you think about the following: Create transaction.h and transaction.c. They would keep the knoledge about the following things: - Current transaction state (is in autocommit mode, in transaction, and the savepoint stack structure. - Each transaction stack point would maintain a list of open cursors. The stack would contain the following things: - At the bottom of the stack is the autocommit mode (tr[0]). - tr[1] contains the transaction's BEGIN block state. - tr[2] contains the information about the first savepoint. This would make the savepoint rollback work with cursors: ODBC side manages the open cursors during savepoint rollback. Rolling back a savepoint destroys that savepoint's and the later savepoint's cursors. ODBC must not try to close the cursor after rollback, or a database error occurs. What do you think? Is this transaction state tracking necessary in the ODBC side? Or does or will the database backend handle this some day some way? Marko Ristola