| From: | Rob Bygrave <robin(dot)bygrave(at)gmail(dot)com> |
|---|---|
| To: | Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> |
| Cc: | Steven Schlansker <stevenschlansker(at)gmail(dot)com>, pgsql-jdbc(at)lists(dot)postgresql(dot)org |
| Subject: | Re: How to set transaction isolation level for the given transaction only. |
| Date: | 2020-08-14 05:24:26 |
| Message-ID: | CAC=ts-FreXkEdVyuFhW4xNqzCcZ8jpUzK7bnBnANvmuTsGMYbA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-jdbc |
You can set the transaction isolation level on the connection using the
setTransactionIsolation method.
java.sql.Connection#setTransactionIsolation()
I believe that is what you are looking for.
Cheers, Rob.
On Fri, 14 Aug 2020 at 17:16, Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> wrote:
>
>
> On Thu, Aug 13, 2020 at 11:16 PM Steven Schlansker <
> stevenschlansker(at)gmail(dot)com> wrote:
>
>> Maybe there's a neat way of doing this in the driver I'm not aware of,
>> but usually this is left to the job of a higher level library or class you
>> write yourself.
>>
>> To shamelessly plug my own, Jdbi handles this nicely:
>>
>> http://jdbi.org/apidocs/org/jdbi/v3/core/Handle.html#inTransaction-org.jdbi.v3.core.transaction.TransactionIsolationLevel-org.jdbi.v3.core.HandleCallback-
>>
>>
> Thanks for the info, I will try the similar on my own.
>
>
> --
> Best Regards
> Andy Fan
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Vladimir Sitnikov | 2020-08-14 18:25:20 | [pgjdbc/pgjdbc] |
| Previous Message | Andy Fan | 2020-08-14 05:16:32 | Re: How to set transaction isolation level for the given transaction only. |