Large Objects; ODBC & Transactions - Mailing list pgsql-odbc

From Mike Miller
Subject Large Objects; ODBC & Transactions
Date
Msg-id NFBBKNGDCLACAKIKLJIPOEMHCBAA.mmiller@pooka.otago.ac.nz
Whole thread Raw
List pgsql-odbc
First it was ODBC & Transactions; now I've added Large Objects into the
soup!

I'm using the a modified version of the VB code (POSTGRESQL, LO and VISUAL
BASIC MINI-HOWTO) by Denis Gasparin found at
http://odbc.postgresql.org/ftpsite/odbc/pgsql-lo-vb-MiniHowto.txt

When trying to update a table with the code I get the error message :-

Could not begin (in-line) a transaction

*if* I have *already* started a transaction.  If there is no transaction;
then the code works fine (which is a good thing).

You can see below;

my BEGIN WORK,
my update practical set description ...
*NOT* my BEGIN
--> FAILED
should be followed by
my update practical set picture ...

psqlodbc-log

conn=136331840, query='BEGIN WORK'
conn=136331840, query='update Practical set Description = 'An introduction
to ... [SNIP]
conn=136331840, query='BEGIN'
NOTICE from backend during send_query: 'NOTICE:  BEGIN: already a
transaction in progress
'
STATEMENT ERROR: func=copy_statement_with_parameters, desc='', errnum=1,
errmsg='Could not begin (in-line) a transaction'
                 -----------------------------------------------------------
-
                 hdbc=136331840, stmt=126552752, result=0
                 manual_result=0, prepare=0, internal=0
                 bindings=0, bindings_allocated=0
                 parameters=126558144, parameters_allocated=1
                 statement_type=2, statement='update Practical set Picture =
? where PracticalID = 1'
                 stmt_with_params='update Practical set Picture = n = 'An
introduction [SNIP]
                 data_at_exec=-1, current_exec_param=-1, put_data=0
                 currTuple=-1, current_col=-1, lobj_fd=-1
                 maxRows=0, rowset_size=1, keyset_size=0, cursor_type=0,
scroll_concurrency=1
                 cursor_name='SQL_CUR078B0AB0'
                 ----------------QResult
Info -------------------------------
CONN ERROR: func=copy_statement_with_parameters, desc='', errnum=0,
errmsg=''
            ------------------------------------------------------------
            henv=126553968, conn=136331840, status=1, num_stmts=16
            sock=126553920, stmts=126553840, lobj_type=62566
            ---------------- Socket Info -------------------------------
            socket=724, reverse=0, errornumber=0, errormsg='(NULL)'
            buffer_in=136342724, buffer_out=136346824
            buffer_filled_in=60, buffer_filled_out=0, buffer_read_in=60
conn=136331840, PGAPI_Disconnect

Shouldn't the code test to see if a transaction is running before it tries
to start another?
Is this a bug?  Does it happen in other tests?  I'm using PostgreSQL 7.1.2
and psqlodbc 07.01.0008.

I don't particularly have a problem with this; I can work around it by
FTPing the file to the server and then adding it to the database using
lo_import - which is what I did originally.

Regards,
Mike Miller
Application Software Developer,
School Of Physical Education,
University Of Otago,
+64 3 479 9123
http://physed.otago.ac.nz


pgsql-odbc by date:

Previous
From: Dave Page
Date:
Subject: Re: Last inserted id
Next
From: Hiroshi Inoue
Date:
Subject: Re: Large Objects; ODBC & Transactions