Opened 15 years ago

Closed 15 years ago

#1350 closed enhancement (fixed)

Update to Hibernate 3.3.2

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.13
Component: core Version:
Keywords: Cc:

Description

This update includes the following fix: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3528

This issue has prevented us from using proxies with batchable classes. Because of this we have also been forced to FETCH JOIN data that we are not interested in since otherwise the lack of proxies would generate lots of SELECTs for the linked items. There is a short note about this in the documentation http://base.thep.lu.se/chrome/site/latest/html/developerdoc/core_ref/core_ref.rules.datalayer.html#core_ref.rules.datalayer.proxies

I am not sure of all places in the code that may benefit from this. One example is in the RawBioAssay.validateFeatures() method. I guess there are a more places in the code, most likely in code that handles raw data, array design features and reporters.

Change History (7)

comment:1 by Nicklas Nordborg, 15 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 by Nicklas Nordborg, 15 years ago

(In [5025]) References #1350: Update to Hibernate 3.3.2

The new JAR files are in place and seems to work. No queries has been changed yet.

comment:3 by Nicklas Nordborg, 15 years ago

(In [5026]) References #1350: Update to Hibernate 3.3.2

comment:4 by Nicklas Nordborg, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [5027]) Fixes #1350: Update to Hibernate 3.3.2

Updated documentation.

comment:5 by Nicklas Nordborg, 15 years ago

Resolution: fixed
Status: closedreopened

Discovered a bug in Hibernate that can cause really bad problems in BASE. It is simple to re-create:

  1. Log in to BASE
  2. Create a new project
  3. Select BASE -> Reload permissions from the menu

After that almost every page access results in a very long strack trace with the following root cause near the end of the list:

java.sql.SQLException: Parameter index out of bounds. 11 is not between valid values of 1 and 10
	com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
	com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
	com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
	com.mysql.jdbc.ServerPreparedStatement.getBinding(ServerPreparedStatement.java:930)
	com.mysql.jdbc.ServerPreparedStatement.setInt(ServerPreparedStatement.java:1996)
	com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setInt(NewProxyPreparedStatement.java:677)
	org.hibernate.type.IntegerType.set(IntegerType.java:64)
	org.hibernate.type.NullableType.nullSafeSet(NullableType.java:154)
	org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136)
	org.hibernate.param.DynamicFilterParameterSpecification.bind(DynamicFilterParameterSpecification.java:78)
	org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:514)
	org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1593)
	org.hibernate.loader.Loader.doQuery(Loader.java:696)
	org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
	org.hibernate.loader.Loader.doList(Loader.java:2232)
	org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2161)
	org.hibernate.loader.Loader.list(Loader.java:2121)
	org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
	org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
	org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
	org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
	org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
	net.sf.basedb.core.hibernate.QueryWrapper.list(QueryWrapper.java:102)
	net.sf.basedb.core.HibernateUtil.loadList(HibernateUtil.java:1574)
	net.sf.basedb.core.ItemQuery.list(ItemQuery.java:92)
	org.apache.jsp.include.menu_jsp._jspService(menu_jsp.java:1271)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
	org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:621)
	net.sf.basedb.clients.web.taglib.Body.doStartTag(Body.java:279)
	org.apache.jsp.my_005fbase.projects.list_005fprojects_jsp._jspService(list_005fprojects_jsp.java:427)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:70)

The only workarounds seems to be to re-start Tomcat.

Similar problems can also appear when doing other things such as changing the active project or modifying the permissions on an item.

The problem is believed to be a bug in Hibernate 3.3.2 and has been reported to the Hibernate developers: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4065

comment:6 by Nicklas Nordborg, 15 years ago

(In [5037]) References #1350: Update to Hibernate 3.3.2

Added a very ugly hack that effectively disables the query plan cache in Hibernate. This forces all queries to be rebuilt from scratch at all times and ensures that the proper number of parameter placeholders are added to the final SQL. The disabling of the cache may result in some performance degradation but this has not yet been investigated.

comment:7 by Nicklas Nordborg, 15 years ago

Resolution: fixed
Status: reopenedclosed

Closing this, but we should upgrade Hibernate as soon as HHH-4065 is fixed. See #1364.

Note: See TracTickets for help on using tickets.