caveat to aggressive connection closing
git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@6511 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
2f937fd686
commit
208e30e25c
|
@ -513,6 +513,17 @@ Session sess = factory.getCurrentSession();
|
|||
Hibernate.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
There is one caveat to the use of <literal>auto_close_session</literal>. Due to a limitation
|
||||
of the JTA spec, it is not possible for Hibernate to automatically clean up any unclosed
|
||||
<literal>ScrollableResults</literal> or <literal>Iterator</literal> instances returned by
|
||||
<literal>scroll()</literal> or <literal>iterate()</literal>. You <emphasis>must</emphasis>
|
||||
release the underlying database cursor by calling <literal>ScrollableResults.close()</literal>
|
||||
or <literal>Hibernate.close(Iterator)</literal> explicity from a <literal>finally</literal>
|
||||
block. (Of course, most applications can easily avoid using <literal>scroll()</literal> or
|
||||
<literal>iterate()</literal> at all from the CMT code.)
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="transactions-demarcation-exceptions">
|
||||
|
|
Loading…
Reference in New Issue