Transaction handling in extended query mode and Sync message issues

From: Carlos Guzman Alvarez <carlosga(at)telefonica(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Transaction handling in extended query mode and Sync message issues
Date: 2003-07-09 12:05:18
Message-ID: 3F0C04FE.2070002@telefonica.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello:

I continue to work in the implementation of the 3.0 protocol in C#, i'm
making a test that consist on:

- Create a database.
- Create a table in the new database.
- Start transaction.
- Insert 100 rows of data in the new table.
- Commit transaction.

For start a transaction i send a Query message with this as statement text:

START TRANSACTION ISOLATION LEVEL READ COMMITTED

For commit a transaction i send a Query message with this as statement text:

COMMIT TRANSACTION

For execute the inserts i use parametrized commands with Extended query
mode, sending this sequence of messages:

- Parse & Flush ( Only for the first command )
- Describe & Flush ( Only for the first command )
- Close Portal ( begining at second command )
- Bind & Flush
- Execute & Sync

But the Sync message seems to be commiting the transaction, if i send a
Flush message all works as expected with inserts, but create database &
table will not work.

In the extended query mode documentation i see this:

"Note: Sync does not cause a transaction block opened with BEGIN to be
closed. It is possible to detect this situation since the ReadyForQuery
message includes transaction status information."

I have tested the same cycle with a BEGIN WORK but having the same
problem, any idea on what i'm doing wrong ???

Tanks in advance :)

--
Best regards

Carlos Guzmán Álvarez
Vigo-Spain

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2003-07-09 13:26:28 Re: sugsestions
Previous Message Carlos Guzman Alvarez 2003-07-09 08:20:34 Re: CREATE DATABASE command in Extended Query mode of 3.0