Jun 10, 2014, 1:27:02 PM (7 years ago)
Nicklas Nordborg

References #1742: Upgrade to Hibernate 4.x

Updated to Hibernate 4.3.5.

  • Some 3rd-party libs has been updated/changed
  • PostgreSQLDialect has been deprecated and must be replaced with PostgreSQL9Dialect (affects base.config). Documentation need to be updated.
  • 2nd-level cache is configured differently. Hibernate will start, but I have not verified that it is actually used.
  • HibernateUtil.doJdbcWork() replaced with HibernateUtil.doWork() and HibernateUtil.doReturningWork() since Hibernate now has built-in support for return information from a work. Removed JdbcWork and lots of other changes needed because of this.
  • EntityMode parameter is no longer needed in lots of methods (I guess Hibernate has dropped support for other modes than POJO).
  • Quota.quotaValues changed from Map to Set since I could not get the map implemenation to work with Hibernate. The maxBytes property is now part of QuotaIndex.
  • Some internal Hibernate API has moved around to other packages.
  • unique-key annotations are now prefixed with the class name they appear in to avoid problems with accidentally duplicating another name (which fails in PostgreSQL since Hibernate has changed the naming strategy).

So far I have tested installation and TestAll on PostgreSQL. Need to test MySQL and updating also.

There are also some remaining calls to deprecated methods in Hibernate.

1 edited


  • trunk/config/dist/hibernate.cfg.xml

    r6330 r6468  
    3434    <property name="connection.release_mode">after_transaction</property>
    36     <!-- HQL parser options -->
    37     <property name="query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
    3936    <!-- Connection pool options -->
    4037    <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
    4542    <!-- Second-level cache options -->
    46     <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
     43    <property name="cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>
    4744    <property name="cache.use_query_cache">true</property>
     45    <property name="cache.use_second_level_cache">true</property>
    4846    <class-cache
    4947      class="net.sf.basedb.core.data.AnnotationTypeData"
Note: See TracChangeset for help on using the changeset viewer.