Re: [JDBC] problem with new autocommit config parameter

From: Barry Lind <barry(at)xythos(dot)com>
To: Daryl Beattie <dbeattie(at)insystems(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: [JDBC] problem with new autocommit config parameter
Date: 2002-09-09 19:29:02
Message-ID: 3D7CF67E.9000007@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

Daryl,

The problem is an incompatiblity between a new server autocommit feature
and the existing jdbc autocommit feature. The problem manifests itself
when you turn autocommit off on the server (which is new functionality
in 7.3). If you leave autocommit turned on on the server (which is the
way the server has always worked until 7.3) the jdbc driver correctly
handles issuing the correct begin/commit/rollback commands to support
autocommit functionality in the jdbc driver.

Autocommit will work with jdbc in 7.3 (and it does now as long as you
leave autocommit set on in the postgresql.conf file). We are just need
to decide what to do in this one corner case.

thanks,
--Barry

Daryl Beattie wrote:
> Dear PostgreSQL people,
>
> Sorry for jumping into this conversation in the middle.
> Autocommit is very important, as appservers may turn it on or off at
> will in order to support EJB transactions (being able to set them up, roll
> them back, commit them, etc. by using the JDBC API). If it is broken, then
> all EJB apps using PostgreSQL may be broken also. ...This frightens me a
> little. Could somebody please explain?
>
> Sincerely,
>
> Daryl.
>
>
>
>>-----Original Message-----
>>From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
>>Sent: Monday, September 09, 2002 2:54 PM
>>To: Bruce Momjian
>>Cc: Barry Lind; pgsql-jdbc(at)postgresql(dot)org;
>>pgsql-hackers(at)postgresql(dot)org
>>Subject: Re: [JDBC] [HACKERS] problem with new autocommit config
>>parameter and jdbc
>>
>>
>>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>>
>>>Barry Lind wrote:
>>>
>>>>How should client interfaces handle this new autocommit
>>>
>>feature? Is it
>>
>>>>best to just issue a set at the beginning of the
>>>
>>connection to ensure
>>
>>>>that it is always on?
>>>
>>>Yes, I thought that was the best fix for apps that can't deal with
>>>autocommit being off.
>>
>>If autocommit=off really seriously breaks JDBC then I don't think a
>>simple SET command at the start of a session is going to do that much
>>to improve robustness. What if the user issues another SET to turn it
>>on?
>>
>>I'd suggest just documenting that it is broken and you can't use it,
>>until such time as you can get it fixed. Band-aids that only
>>partially
>>cover the problem don't seem worth the effort to me.
>>
>>In general I think that autocommit=off is probably going to be very
>>poorly supported in the 7.3 release. We can document it as being
>>"work in progress, use at your own risk".
>>
>> regards, tom lane
>>
>>---------------------------(end of
>>broadcast)---------------------------
>>TIP 3: if posting/reading through Usenet, please send an appropriate
>>subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>>message can get through to the mailing list cleanly
>>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2002-09-09 19:41:59 Re: Rule updates and PQcmdstatus() issue
Previous Message Ross J. Reedstrom 2002-09-09 19:25:48 Re: Rule updates and PQcmdstatus() issue

Browse pgsql-jdbc by date

  From Date Subject
Next Message Daniel Serodio 2002-09-09 20:08:07 Closing Statements and ResultSets
Previous Message Daryl Beattie 2002-09-09 19:01:23 Re: [JDBC] problem with new autocommit config parameter