Re: select current_setting('transaction_isolation')

From: Samba <saasira(at)gmail(dot)com>
To: David Kerr <dmk(at)mr-paradox(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select current_setting('transaction_isolation')
Date: 2012-06-02 08:49:34
Message-ID: CAKgWO9Kt-V7=xDmzfrD8Uzq_NqRe0fYBeRdXoCSoijoPwNmqOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

JDBC does not query the database for the transaction isolation level for
the current session/connection on its own unless you application [or even
it could be hibernate] queries the same by calling :
connection.getTransactionIsolation()
method.

I doubt even if Hibernate would do that since it does not need to query
each time what the transaction isolation level of the current connection is
and would most probably cache that info in each Session instance.

So, it would be better you verify if your application specific code is
relying on some particular transaction isolation level and is ensuring that
the every query run on the database is actually running under that
particular transaction isolation level.

Regards,
Samba

============================================================

On Wed, May 30, 2012 at 5:35 AM, David Kerr <dmk(at)mr-paradox(dot)net> wrote:

> Howdy,
>
> I recently did a log_min_duration_statement=0 run on my app, and found
> ~3million copies of
> "select current_setting('transaction_isolation')"
>
> I'm a Java + Hibernate stack. Does anyone know if this is a Hibernate
> artifact? or a jdbc artifact?
> or something else (implicit to some query pattern or trigger)?
>
> Thanks
>
> Dave
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message idc danny 2012-06-02 17:05:30 Array fundamentals
Previous Message Jasen Betts 2012-06-02 07:14:36 Re: Updateable Views or Synonyms.