This seems to only be problematic when using the native Hibernate API. As a workaround, you could use the JPA EntityManager API and the failure does not occur.