Re: JDBC behaviour

From: Sridhar N Bamandlapally <sridhar(dot)bn1(at)gmail(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC behaviour
Date: 2016-02-18 10:02:20
Message-ID: CAGuFTBWrsMQBhrYkOUt3eNFE2RMd4Mpkzxg32ejjMFhqBwfb0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-jdbc

Andreas, ROLLBACK doesn't work as it do for all previous statements,

autocommit ON is not option as it controlled by connection pool,

with this the simple "statement" with need to replace with "try-catch",
"savepoint", "statement" and "rollback to savepoint", this looks lot of
changes in code to make it app/java-database compatible,

still, this is bug

On Thu, Feb 18, 2016 at 3:22 PM, John R Pierce <pierce(at)hogranch(dot)com> wrote:

> On 2/18/2016 1:42 AM, Sridhar N Bamandlapally wrote:
>
>>
>> but why?, this is not expected behavior
>>
>> autocommit is just autocommit, its not responsible to treat
>> multi-transactions as single or independent
>>
>>
>>
> its exactly how jdbc is defined to work, fit into postgres's transaction
> model.
>
> if autocommit is ON, then every statement is a standalone query.
>
> if autocommit is OFF, then its in transaction mode. JDBC has an
> implicit transaction start when you execute the first query, and you have
> to commit or rollback the transaction.
>
>
> if you want each INSERT to run indepedently, then use autocommit ON.
>
> --
> john r pierce, recycling bits in santa cruz
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vladimir Sitnikov 2016-02-18 10:05:10 Re: JDBC behaviour
Previous Message John R Pierce 2016-02-18 09:52:45 Re: JDBC behaviour

Browse pgsql-hackers by date

  From Date Subject
Next Message Vladimir Sitnikov 2016-02-18 10:05:10 Re: JDBC behaviour
Previous Message John R Pierce 2016-02-18 09:52:45 Re: JDBC behaviour

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vladimir Sitnikov 2016-02-18 10:05:10 Re: JDBC behaviour
Previous Message John R Pierce 2016-02-18 09:52:45 Re: JDBC behaviour