Skip to content

Commit 46a6293

Browse files
committed
HHH-9503 - Consistently accept numeric value or Connection constant field name for configuring transaction isolation
1 parent d99fb4f commit 46a6293

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

documentation/src/main/docbook/manual/en-US/chapters/jdbc/Database_Access.xml

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@
112112
are recognized.
113113
</para>
114114

115+
<para>
116+
Transaction isolation of the Connections is managed by the ConnectionProvider itself. See
117+
<xref linkend="database-connectionprovider-isolation"/>.
118+
</para>
119+
115120
<variablelist>
116121
<title>Additional settings</title>
117122
<varlistentry>
@@ -230,6 +235,11 @@
230235
connection pooling.
231236
</para>
232237

238+
<para>
239+
Transaction isolation of the Connections is managed by the ConnectionProvider itself. See
240+
<xref linkend="database-connectionprovider-isolation"/>.
241+
</para>
242+
233243
<section xml:id="database-connectionprovider-proxool-existing">
234244
<title>Using existing Proxool pools</title>
235245

@@ -260,7 +270,6 @@
260270
See <link xlink:href="http://proxool.sourceforge.net/configure.html"/>.
261271
<literal>hibernate.proxool.pool_alias</literal> must be set to indicate which pool to use.
262272
</para>
263-
264273
</section>
265274
</section>
266275

@@ -315,7 +324,11 @@
315324
<varlistentry>
316325
<term><literal>hibernate.connection.isolation</literal></term>
317326
<listitem>
318-
<para>Mapped to Hikari's <literal>transactionIsolation</literal> setting</para>
327+
<para>
328+
Mapped to Hikari's <literal>transactionIsolation</literal> setting. See
329+
<xref linkend="database-connectionprovider-isolation"/>. Note that
330+
Hikari only supports JDBC standard isolation levels (apparently).
331+
</para>
319332
</listitem>
320333
</varlistentry>
321334
<varlistentry>
@@ -350,6 +363,42 @@
350363
</para>
351364
</section>
352365

366+
<section xml:id="database-connectionprovider-isolation">
367+
<title>ConnectionProvider support for transaction isolation setting</title>
368+
<para>
369+
All of the provided ConnectionProvider implementations, other than DataSourceConnectionProvider,
370+
support consistent setting of transaction isolation for all Connections obtained from the underlying
371+
pool. The value for <literal>hibernate.connection.isolation</literal> can be specified in
372+
one of 3 formats:
373+
<itemizedlist>
374+
<listitem>
375+
<para>
376+
the integer value accepted at the JDBC level
377+
</para>
378+
</listitem>
379+
<listitem>
380+
<para>
381+
the name of the <interfacename>java.sql.Connection</interfacename> constant field
382+
representing the isolation you would like to use. For example,
383+
<literal>TRANSACTION_REPEATABLE_READ</literal> for
384+
<methodname>java.sql.Connection#TRANSACTION_REPEATABLE_READ</methodname>. Not that this is
385+
only supported for JDBC standard isolations, not for isolation levels specific to
386+
a particular JDBC driver.
387+
</para>
388+
</listitem>
389+
<listitem>
390+
<para>
391+
a short-name version of the <interfacename>java.sql.Connection</interfacename> constant field
392+
without the <literal>TRANSACTION_</literal> prefix. For example,
393+
<literal>REPEATABLE_READ</literal> for
394+
<methodname>java.sql.Connection#TRANSACTION_REPEATABLE_READ</methodname>. Again, this is
395+
only supported for JDBC standard isolations, not for isolation levels specific to
396+
a particular JDBC driver.
397+
</para>
398+
</listitem>
399+
</itemizedlist>
400+
</para>
401+
</section>
353402
</section>
354403

355404

0 commit comments

Comments
 (0)