<?xml version='1.0' encoding='utf-8' ?>

<!--
  ~ Hibernate, Relational Persistence for Idiomatic Java
  ~
  ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
  ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
  -->
<appendix xmlns="http://docbook.org/ns/docbook">

    <title>Troubleshooting</title>

    <section>
        <title>Log messages</title>
        <para>
            This section discusses certain log messages you might see from Hibernate and the "meaning" of those
            messages.  Specifically, it will discuss certain messages having a "message id", which for Hibernate
            is always the code <literal>HHH</literal> followed by a numeric code.  The table below is ordered
            by this code.
        </para>
        <table>
            <title>Explanation of identified log messages</title>
            <tgroup cols="2">
                <thead>
                    <row>
                        <entry>Key</entry>
                        <entry>Explanation</entry>
                    </row>
                </thead>
                <tbody>
                    <row>
                        <entry>HHH000002</entry>
                        <entry>
                            <para>
                                Indicates that a session was left associated with the
                                <classname>org.hibernate.context.internal.ThreadLocalSessionContext</classname> that is used
                                to implement thread-based current session management.  Internally that class uses a
                                ThreadLocal, and in environments where Threads are pooled this could represent a
                                potential "bleed through" situation.  Consider using a different
                                <interfacename>org.hibernate.context.spi.CurrentSessionContext</interfacename>
                                implementation.  Otherwise, make sure the sessions always get unbound properly.
                            </para>
                        </entry>
                    </row>
                    <row>
                        <entry>HHH000408</entry>
                        <entry>
                            <para>
                                Using workaround for JVM bug in <classname>java.sql.Timestamp</classname>.  Certain
                                JVMs are known to have a bug in the implementation of
                                <classname>java.sql.Timestamp</classname> that causes the following condition to
                                evaluate to <literal>false</literal>: <code>new Timestamp(x).getTime() != x</code>.
                                A huge concern here is to make sure you are not using temporal based optimistic
                                locking on such JVMs.
                            </para>
                        </entry>
                    </row>
                </tbody>
            </tgroup>
        </table>
    </section>

</appendix>