title: Hibernate connection with HSQLDB
body: <p>I have a problem while setting up my first Hibernate project. I follow the tutorial and get stuck when I launch my code. What happens is that the program get stuck, I believe, when starting the connection with HSQLDB. It does not provide any error message.<br>
  The verbose output in the console is the following:</p>
  
  <pre><code>172 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
  172 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.6.10.Final
  172 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
  187 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
  187 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
  265 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
  265 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
  375 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : org/itg/ACLwithHibernate/User.hbm.xml
  484 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
  </code></pre>
  
  <p>now it is configured, I call buildSessionFactory():</p>
  
  <pre><code>562 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: org.itg.ACLwithHibernate.User -&gt; USER
  577 [main] INFO org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
  593 [main] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
  593 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
  593 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 10
  593 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
  609 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost:9001
  609 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=sa, password=****}
  </code></pre>
  
  <p>and... nothing more. It never goes on to the next instructions in my main() class. It is stuck somewhere.
  When I debug, I get this:</p>
  
  <p><a href="http://s7.postimage.org/51xzluq3t/debug_Hibernate.png" rel="nofollow">overview of the debugger</a></p>
  
  <p>Here is my hibernate.cfg.xml:</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
  
      &lt;session-factory&gt;
  
          &lt;!-- Database connection settings --&gt;
          &lt;property name="connection.driver_class"&gt;org.hsqldb.jdbcDriver&lt;/property&gt;
          &lt;property name="connection.url"&gt;jdbc:hsqldb:hsql://localhost:9001&lt;/property&gt;
          &lt;property name="connection.username"&gt;sa&lt;/property&gt;
          &lt;property name="connection.password"&gt;&lt;/property&gt;
  
          &lt;!-- JDBC connection pool (use the built-in) --&gt;
          &lt;property name="connection.pool_size"&gt;10&lt;/property&gt;
  
          &lt;!-- SQL dialect --&gt;
          &lt;property name="dialect"&gt;org.hibernate.dialect.HSQLDialect&lt;/property&gt;
  
          &lt;!-- Enable Hibernate's automatic session context management --&gt;
          &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  
          &lt;!-- Disable the second-level cache  --&gt;
          &lt;property name="cache.provider_class"&gt;org.hibernate.cache.NoCacheProvider&lt;/property&gt;
  
          &lt;!-- Echo all executed SQL to stdout --&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
  
          &lt;!-- Drop and re-create the database schema on startup --&gt;
          &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt;
  
          &lt;mapping resource="org/itg/ACLwithHibernate/User.hbm.xml"/&gt;
  
      &lt;/session-factory&gt;
  
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>My HSQLDB server is running and outputed the following:</p>
  
  <pre><code>[Server@3ed5dee4]: [Thread[org.hsqldb.Server.main(),5,org.hsqldb.Server]]: checkRunning(false) entered
  [Server@3ed5dee4]: [Thread[org.hsqldb.Server.main(),5,org.hsqldb.Server]]: checkRunning(false) exited
  [Server@3ed5dee4]: Startup sequence initiated from main() method
  [Server@3ed5dee4]: Loaded properties from [C:\Users\dbr\workspace\test_hibernate\server.properties]
  [Server@3ed5dee4]: Initiating startup sequence...
  [Server@3ed5dee4]: Server socket opened successfully in 0 ms.
  [Server@3ed5dee4]: Database [index=0, id=0, db=file:target/data/tutorial, alias=] opened sucessfully in 630 ms.
  [Server@3ed5dee4]: Startup sequence completed in 640 ms.
  [Server@3ed5dee4]: 2012-07-18 12:36:53.717 HSQLDB server 2.0.0 is online on port 9001
  [Server@3ed5dee4]: To close normally, connect and execute SHUTDOWN SQL
  [Server@3ed5dee4]: From command line, use [Ctrl]+[C] to abort abruptly
  </code></pre>
  
  <p>When server.silent = false, I get in addition the following when my client connects:</p>
  
  <pre><code>[Thread[HSQLDB Server @1af5458a,5,org.hsqldb.Server]]: handleConnection(Socket[addr=/127.0.0.1,port=49438,localport=9001]) entered
  [Thread[HSQLDB Server @1af5458a,5,org.hsqldb.Server]]: handleConnection() exited
  [Thread[HSQLDB Connection @9437a04,5,HSQLDB Connections @1af5458a]]: ODBC client connected.  ODBC Protocol Compatibility Version 0.0
  </code></pre>
  
  <p>Have you encountered a similar issue before? Do you have an idea about what is going wrong?<br>
  Thank you very much in advance.<br>
  Dany</p>