HHH-9503 - Consistently accept numeric value or Connection constant field name for configuring transaction isolation

This commit is contained in:
Steve Ebersole 2015-08-04 19:55:51 -05:00
parent d99fb4f5dc
commit 46a629382e
1 changed files with 51 additions and 2 deletions

View File

@ -112,6 +112,11 @@
are recognized. are recognized.
</para> </para>
<para>
Transaction isolation of the Connections is managed by the ConnectionProvider itself. See
<xref linkend="database-connectionprovider-isolation"/>.
</para>
<variablelist> <variablelist>
<title>Additional settings</title> <title>Additional settings</title>
<varlistentry> <varlistentry>
@ -230,6 +235,11 @@
connection pooling. connection pooling.
</para> </para>
<para>
Transaction isolation of the Connections is managed by the ConnectionProvider itself. See
<xref linkend="database-connectionprovider-isolation"/>.
</para>
<section xml:id="database-connectionprovider-proxool-existing"> <section xml:id="database-connectionprovider-proxool-existing">
<title>Using existing Proxool pools</title> <title>Using existing Proxool pools</title>
@ -260,7 +270,6 @@
See <link xlink:href="http://proxool.sourceforge.net/configure.html"/>. See <link xlink:href="http://proxool.sourceforge.net/configure.html"/>.
<literal>hibernate.proxool.pool_alias</literal> must be set to indicate which pool to use. <literal>hibernate.proxool.pool_alias</literal> must be set to indicate which pool to use.
</para> </para>
</section> </section>
</section> </section>
@ -315,7 +324,11 @@
<varlistentry> <varlistentry>
<term><literal>hibernate.connection.isolation</literal></term> <term><literal>hibernate.connection.isolation</literal></term>
<listitem> <listitem>
<para>Mapped to Hikari's <literal>transactionIsolation</literal> setting</para> <para>
Mapped to Hikari's <literal>transactionIsolation</literal> setting. See
<xref linkend="database-connectionprovider-isolation"/>. Note that
Hikari only supports JDBC standard isolation levels (apparently).
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
@ -350,6 +363,42 @@
</para> </para>
</section> </section>
<section xml:id="database-connectionprovider-isolation">
<title>ConnectionProvider support for transaction isolation setting</title>
<para>
All of the provided ConnectionProvider implementations, other than DataSourceConnectionProvider,
support consistent setting of transaction isolation for all Connections obtained from the underlying
pool. The value for <literal>hibernate.connection.isolation</literal> can be specified in
one of 3 formats:
<itemizedlist>
<listitem>
<para>
the integer value accepted at the JDBC level
</para>
</listitem>
<listitem>
<para>
the name of the <interfacename>java.sql.Connection</interfacename> constant field
representing the isolation you would like to use. For example,
<literal>TRANSACTION_REPEATABLE_READ</literal> for
<methodname>java.sql.Connection#TRANSACTION_REPEATABLE_READ</methodname>. Not that this is
only supported for JDBC standard isolations, not for isolation levels specific to
a particular JDBC driver.
</para>
</listitem>
<listitem>
<para>
a short-name version of the <interfacename>java.sql.Connection</interfacename> constant field
without the <literal>TRANSACTION_</literal> prefix. For example,
<literal>REPEATABLE_READ</literal> for
<methodname>java.sql.Connection#TRANSACTION_REPEATABLE_READ</methodname>. Again, this is
only supported for JDBC standard isolations, not for isolation levels specific to
a particular JDBC driver.
</para>
</listitem>
</itemizedlist>
</para>
</section>
</section> </section>