title: Using Joda DateTime with Hibernate in H2 Database - SQLError
body: <p>I'm using JPA - Hibernate 2.1 with Joda DateTime. For DateTime conversion I'm using org.jadira.usertype to work with Hibernate. This works all fine for development and local testing with H2 in-memory DB. But on our Jenkins server the tests always fail with some strange SQLExceptions. </p>
  
  <pre><code>WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 90003, SQLState: 90003
  ERROR o.h.e.jdbc.spi.SqlExceptionHelper - Hexadecimal string with odd number of characters: "2015-01-22 14:15:52.965"; SQL statement:
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 90004, SQLState: 90004
  ERROR o.h.e.jdbc.spi.SqlExceptionHelper - Hexadecimal string contains non-hex character: "2015-01-22 14:15:52.98"; SQL statement:
  </code></pre>
  
  <p>It's pretty hard to find out why it's working on my laptop and not on the server. The only difference is that the server is running on an Ubuntu VM and I'm using Windows 8.1 - do I need to consider something like e.g. that OpenJDK could cause problem? Or is this a know H2 DB issue - but I could find anything?
  Any idea why and what I can do to solve it? </p>
  
  <p>Thank you! </p>
  
  <p>The field which causes problem:</p>
  
  <pre><code>@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)//tried to remove this without success
  private DateTime lastSeen;
  </code></pre>
  
  <p>persistence.xml - JPA properties. </p>
  
  <pre><code>&lt;property name="jpaProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.hbm2ddl.auto"&gt;create-drop&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.H2Dialect&lt;/prop&gt;
              &lt;prop key="hibernate.connection.CharSet"&gt;utf-8&lt;/prop&gt;
              &lt;prop key="hibernate.connection.characterEncoding"&gt;utf-8&lt;/prop&gt;
              &lt;prop key="hibernate.connection.useUnicode"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.hbm2ddl.import_files"&gt;test-import.sql&lt;/prop&gt;
              &lt;prop key="jadira.usertype.autoRegisterUserTypes"&gt;true&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  </code></pre>