Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#786 closed (fixed)

Hibernate upgrade

Reported by: Fredrik Levander Owned by: olle
Milestone: Proteios SE 2.18.0 Keywords:
Cc:

Description

There are problems with MySQL 5.5 with the current Hibernate version. Hibernate and MySQL connector should be upgraded to new stable version.

Change History (20)

comment:1 Changed 8 years ago by olle

Status: newassigned

Ticket accepted.

comment:2 Changed 8 years ago by olle

Background discussion.

Hibernate can be found in api/external/hibernate3.jar. All 3.* versions of Hibernate use the filename hibernate3.jar. The full version number can be found in either of the files

META-INF/maven/org.hibernate/hibernate-core/pom.properties
META-INF/maven/org.hibernate/hibernate-core/pom.xml

inside the jar-file. Current version for Proteios SE is Hibernate 3.3.1.GA.

An upgrade of Hibernate is normally performed for a specific reason, since the default is "never change a winning team", and the operation is not trivial. In the current case, the reason is spurious errors occurring for jobs involving massive database access and MySQL 5.5, while no problems were experienced with earlier versions of MySQL. It is not obvious that Hibernate is the culprit, but it is a possibility.

Proteios SE sister project BASE (http://base.thep.lu.se) has gone through several incremental upgrades of Hibernate 3.*, and their experiences can be valuable. The relevant BASE project tickets concerning Hibernate 3.* upgrade and MySQL 5.5 are:

  1. Ticket #1350 (Update to Hibernate 3.3.2).
  2. Ticket #1364 (Update Hibernate when HHH-4065 has been fixed).
  3. Ticket #1488 (Update to Hibernate 3.5.6).
  4. Ticket #1489 (Update to Hibernate 3.6).
  5. Ticket #1566 (MySQL 5.5 no longer supports CREATE TABLE ... TYPE=InnoDB).
  6. Ticket #1650 (Update 3rd-party JAR files) Includes update of Hibernate to 3.6.8.Final.

BASE Ticket #1566 (MySQL 5.5 no longer supports CREATE TABLE ... TYPE=InnoDB) was included for completeness, and has already been managed in Proteios SE Ticket #788 (Update of template files and scripts to allow new versions of external software).

Last edited 8 years ago by olle (previous) (diff)

comment:3 Changed 8 years ago by olle

Comments on BASE tickets for Hibernate upgrade, regarding their relevance to Proteios SE.

  1. Ticket #1350 (Update to Hibernate 3.3.2).
  • Proteios SE java files do not seem to use FETCH JOIN.
  • Proteios SE does not contain a RawBioAssay class.
  • Of all updated files in BASE update [5026], only core/data/FeatureData.java exists in Proteios SE, and it already uses lazy fetching for the Features table.
  • The fix in BASE update [5037] of a Hibernate bug, can hopefully be skipped for Proteios SE, since the bug was fixed in Hibernate 3.3.3 and 3.5.
  1. Ticket #1364 (Update Hibernate when HHH-4065 has been fixed).
  • Related to the fix in BASE update [5037] of the Hibernate bug, that was fixed in Hibernate 3.3.3 and 3.5.
  1. Ticket #1488 (Update to Hibernate 3.5.6).
  • It is not quite clear to what extent Proteios SE is affected by the deprecated constants and methods in Hibernate 3.5.6. Class VirtualColumn is not included in Proteios SE, but class NullableType is referred to in Proteios SE, as is method Type.getHibernateType(), which is referenced in Proteios SE files

    core/AbstractEntityQuery.java
    core/HibernateUtil.java
    core/Type.java

    all in api/core/. To be on the safe side, Proteios SE should start using the TypeWrapper class introduced in BASE updates [5345] and [5346].
  • It is also not clear to what extent Proteios SE is affected by the altered behavior of Hibernate regarding new columns mapped with not-null="true". Proteios SE uses a separate class SchemaVersion to keep track of the database schema version (introduced in change set [1167] in ticket #114 "Update script doesn't work").
  1. Ticket #1489 (Update to Hibernate 3.6).
  • Updates of the TypeWrapper class and stop for use of deprecated methods, begun in BASE ticket #1488 (Update to Hibernate 3.5.6).
  1. Ticket #1566 (MySQL 5.5 no longer supports CREATE TABLE ... TYPE=InnoDB).
  • Already addressed in Proteios SE Ticket #788 (Update of template files and scripts to allow new versions of external software).
  1. Ticket #1650 (Update 3rd-party JAR files) Includes update of Hibernate to 3.6.8.Final.
  • Mostly updates of Hibernate and third party JAR files to new versions.
Last edited 8 years ago by olle (previous) (diff)

comment:4 Changed 8 years ago by olle

Release dates for some Hibernate versions, obtained from http://sourceforge.net/projects/hibernate/files/hibernate3/ and http://sourceforge.net/projects/hibernate/files/hibernate4/.

Hibernate version Release date Comment
Hibernate 3.3.1.GA 2008-09-11 Current version used by Proteios SE
Hibernate 3.6.0.Final 2010-10-14
Hibernate 3.6.8.Final 2011-10-27 Current version used by BASE
Hibernate 3.6.10.Final 2012-02-09 Last Hibernate 3.* version
Hibernate 4.1.9.Final 2012-12-13 Latest Hibernate version at time of writing

comment:5 Changed 8 years ago by olle

Design update.

Proteios SE will be updated to use Hibernate 3.6.8.Final, the Hibernate version currently used by the BASE (http://base.thep.lu.se) project. This will require update of other third-party JAR files and some Proteios SE code:

  1. A number of classes/files in api/core/ need to be updated:
  • New class/file core/hibernate/TypeWrapper.java class should be added from BASE project.
  • Classes/files core/AbstractEntityQuery.java, core/HibernateUtil.java, and core/Type.java should be updated to use methods in new core/hibernate/TypeWrapper class. In addition, class/file core/HibernateUtil.java should be updated by referencing mappings.
  • A copy of class/file api/waf/src/se/lu/thep/waf/util/Values.java needs to be added as api/core/src/org/proteios/util/Values.java, since some of its methods now need to be called by core/Type.java in api/core/.
  • Class/file core/ExtendedPropertyAccessor.java should be updated with new public dummy method Method getMember(), in order to implement updated interface org.hibernate.property.Getter.
  1. Hibernate JAR file api/external/hibernate3.jar should be updated to Hibernate 3.6.8.Final.
  2. Update of a number of other third-party JAR files in api/external/:
New JAR file Replaces JAR file
c3p0-0.9.1.jar c3p0-0.9.0.jar
cglib-2.2.jar cglib-2.1.3.jar
commons-codec-1.4.jar commons-codec-1.3.jar
ehcache-core-2.4.6.jar ehcache-1.2.3.jar
javassist-3.12.0.GA.jar javassist-3.9.0.GA.jar
mysql-connector-java-5.1.18-bin.jar mysql-connector-java-3.1.12-bin.jar
postgresql-9.1-901.jdbc4.jar postgresql-8.0-313.jdbc3.jar
slf4j-api-1.6.4.jar slf4j-log4j12-1.5.8.jar
slf4j-log4j12-1.6.4.jar slf4j-log4j12-1.5.8.jar
  1. A number of new third-party JAR files need to be added to api/external/:
New JAR file Comment
backport-util-concurrent.jar Required by some versions of ehcache
hibernate-jpa-2.0-api-1.0.1.Final.jar Needed because of Hibernate 3.6 design changes
httpclient-4.1.2.jar Needed becouse of design changes in HttpClient project
httpcore-4.1.3.jar Needed becouse of design changes in HttpClient project
  1. Installation shell script misc/install/install.sh needs to be updated to remove replaced JAR files from current installation.
  2. Proteios SE FTP server shell script template file proteios_ftp_server.sh.in in client/ftpd/ should be updated in class path with changes in JAR files.
Last edited 8 years ago by olle (previous) (diff)

comment:6 Changed 8 years ago by olle

(In [4393]) Refs #786. New directory core/hibernate added to api/core/.

comment:7 Changed 8 years ago by olle

Note: Unfortunately, the Proteios SE update to Hibernate 3.6.8.Final was erroneously referenced to Ticket #768 (Project overview sample scroller) instead of Ticket #786. Due to the large number of files involved, the commit will not be reverted, but instead a link to the change set will be inserted for this ticket.

comment:8 Changed 8 years ago by olle

(In [4394]) Refs #786. Proteios SE updated to use Hibernate 3.6.8.Final for Linux distributions.

  1. A number of classes/files in api/core/ updated to comply with deprecated methods and constants in newer Hibernate versions, as well as changes in Hibernate interfaces.
  2. Class/file core/hibernate/TypeWrapper.java in api/core/ added from BASE project, to be used by other classes to handle deprecated methods and constants in newer Hibernate versions.
  3. Hibernate JAR file api/external/hibernate3.jar updated to Hibernate 3.6.8.Final.
  4. Update of a number of other third-party JAR files in api/external/.
  5. Addition of a number of new third-party JAR files to api/external/.
  6. Installation shell script install.sh in misc/install/ updated to remove replaced JAR files from current installation.
  7. Proteios SE FTP server shell script template file proteios_ftp_server.sh.in in client/ftpd/ updated in class path with changes in JAR files.

comment:9 Changed 8 years ago by olle

(In [4395]) Refs #786. Proteios SE FTP server template MS Windows BAT file proteios_ftp_server.bat.in in client/ftpd/ updated in class path with changes in JAR files.

comment:10 Changed 8 years ago by olle

(In [4403]) Refs #786. A number of classes in api/core/ updated by replacing deprecated constant org.hibernate.Hibernate.INTEGER with TypeWrapper.INTEGER.getHibernateType().

comment:11 Changed 8 years ago by olle

(In [4413]) Refs #327. Refs #786. Deprecated method lock(Object, LockMode) in Hibernate session replaced by buildLockRequest(LockOptions).lock(object) in classes/files core/HibernateUtil.java and core/DbControl.java, both in api/core/.

comment:12 Changed 8 years ago by olle

(In [4414]) Refs #327. Refs #786. Deprecated method evict(Class, Serializable) in Hibernate SessionFactory replaced by getCache().containsEntity(Class, Serializable) in class/file core/HibernateUtil.java in api/core/.

comment:13 Changed 8 years ago by olle

Background info:

  • Proteios SE sister project BASE (http://base.thep.lu.se) has updated from Hibernate 3.6.8.Final to Hibernate 3.6.10.Final, the last Hibernate version before version 4, see BASE Ticket #1741 (Update Hibernate and other 3-rd party libraries). Proteios SE should also be updated to Hibernate 3.6.10.Final.
Last edited 8 years ago by olle (previous) (diff)

comment:14 Changed 8 years ago by olle

Design update.

Proteios SE will be updated to use Hibernate 3.6.10.Final, the Hibernate version currently used by the BASE (http://base.thep.lu.se) project. This will require update of other third-party JAR files and some Proteios SE code:

  1. Hibernate JAR file api/external/hibernate3.jar should be updated to Hibernate 3.6.10.Final.
  2. Update of a number of other third-party JAR files in api/external/:
New JAR file Replaces JAR file
antlr-2.7.7.jar antlr-2.7.6.jar
commons-codec-1.6.jar commons-codec-1.4.jar
ehcache-core-2.6.3.jar ehcache-core-2.4.6.jar
httpclient-4.2.3.jar httpclient-4.1.2.jar
httpcore-4.2.3.jar httpcore-4.1.3.jar
jcommon-1.0.17.jar jcommon-1.0.6.jar
json-simple-1.1.1.jar json_simple-1.1.jar
log4j-1.2.17.jar log4j-1.2.15.jar
mail-1.4.5.jar mail.jar (version 1.4.1)
mysql-connector-java-5.1.22-bin.jar mysql-connector-java-5.1.18-bin.jar
postgresql-9.2-1002.jdbc4.jar postgresql-9.1-901.jdbc4.jar
  1. Note: Update of the BASE project to Hibernate 3.6.10.Final included update of JFreeChart to version 1.0.14. However, jfreechart-1.0.14.jar is not compatible with the way Proteios SE spectrum viewer extension annotates mass peaks (Ticket #425 "Show mass values for some peaks in mass spectra"), or creates mass annotations to be shown as tool-tips when the mouse moves near a mass peak (Ticket #618 "Spectrum viewers should show mass values as tool-tips"). Proteios SE will therefore not update the JFreeChart jar file, at least for now.
New JAR file in BASE project update Retained JAR file in Proteios SE for now
jfreechart-1.0.14.jar jfreechart-1.0.2.jar
  1. Installation shell script misc/install/install.sh needs to be updated to remove replaced JAR files from current installation.
  2. Proteios SE FTP server shell script template file proteios_ftp_server.sh.in in client/ftpd/ should be updated in class path with changes in JAR files.
Last edited 8 years ago by olle (previous) (diff)

comment:15 Changed 8 years ago by olle

(In [4423]) Refs #786. Proteios SE updated to use Hibernate 3.6.10.Final for Linux distributions.

  1. Hibernate JAR file api/external/hibernate3.jar updated to Hibernate 3.6.10.Final.
  2. Update of a number of other third-party JAR files in api/external/.
  3. Installation shell script install.sh in misc/install/ updated to remove replaced JAR files from current installation.
  4. Proteios SE FTP server shell script template file proteios_ftp_server.sh.in in client/ftpd/ updated in class path with changes in JAR files.

comment:16 Changed 8 years ago by olle

(In [4424]) Refs #786. Proteios SE updated to use Hibernate 3.6.10.Final for Linux distributions.

  1. Removal of a number of third-party JAR files in api/external/, where new versions of the files have been added.

comment:17 Changed 8 years ago by olle

(In [4425]) Refs #786. Proteios SE FTP server template MS Windows BAT file proteios_ftp_server.bat.in in client/ftpd/ updated in class path with changes in JAR files.

comment:18 Changed 8 years ago by olle

(In [4429]) Refs #786. Following BASE update in change set [5476] in BASE Ticket #1489, URL:s to DTD:s used in various Hibernate mappings files are changed as described in http://opensource.atlassian.com/projects/hibernate/browse/HHH-5485 (http://hibernate.sourceforge.net/*.dtd should be exchanged for http://www.hibernate.org/dtd/*.dtd).

comment:19 Changed 8 years ago by olle

Resolution: fixed
Status: assignedclosed

Ticket closed as Proteios SE has been updated to use Hibernate version 3.6.10.Final.

comment:20 Changed 8 years ago by olle

(In [4440]) Refs #786. Following BASE update in change set [2474] in BASE Ticket #263 (Update to latest version of 3rd-party software), class/file core/HibernateUtil.java in api/core/ is updated in static synchronized method void unload() to close an existing session factory.

Note: See TracTickets for help on using tickets.