Skip site navigation (1) Skip section navigation (2)

Re: can't write a BLOB, 7.1.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dejan Vucinic" <hotdejan(at)hotmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: can't write a BLOB, 7.1.2
Date: 2001-07-11 19:38:55
Message-ID: 3258.994880335@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-jdbc
"Dejan Vucinic" <hotdejan(at)hotmail(dot)com> writes:
>> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>> Probably you are not wrapping the operation into a transaction
>> (BEGIN/COMMIT).  Large object descriptors are only good to the end of
>> the current transaction.

> I believe I am, the code looks like this:

>   connection.setAutoCommit(false);
>   insert = connection.prepareStatement(
>              "INSERT INTO FOO (A, B) VALUES (?, ?)");
>   insert.setString(1, somestring);
>   insert.setBytes(2, byte[] xx);
>   insert.executeUpdate();
>   connection.commit();
>   connection.setAutoCommit(true);

I have no idea what that actually does at the database level.
In particular, does the setAutoCommit(false) routine send a
BEGIN, or does it only set some state that affects later operations?
If there's not a BEGIN sent before the LO operations, they'll fail.

You might try turning on query logging at the postmaster to see
what requests are really being transmitted.

			regards, tom lane

In response to

pgsql-jdbc by date

Next:From: Jörg SommerDate: 2001-07-11 19:43:51
Subject: Methode is not yet implemented.
Previous:From: Dave CramerDate: 2001-07-11 19:24:34
Subject: RE: [PATCH] setTimestamp(int, Timestamp) fails on null timestamp

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group