Opened 11 years ago

Closed 11 years ago

#518 closed defect (fixed)

Installation wizard must be run twice

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: minor Milestone: Reggie v2.13
Component: net.sf.basedb.reggie Keywords:


Sometimes the installation wizard need to update/fix so many things that it causes a transaction failure on some items.

Trying to run the installation wizard a second time reports a lot less items in need of a fix (since the fix worked the first time) and then the wizard is able to fix them as well.

At the moment it is a bit hard to be more specific about details since this problem is impossible to replicate unless the initial database state is backed up and restored before trying again.

A fresh BASE installation with an Reggie 2.12 is probably a good starting point. Back it up and then try updating to Reggie 2.13. Restore from the backup and repeat until the problem can be identified.

Attachments (1)

install-wizard-518.png (109.5 KB ) - added by Nicklas Nordborg 11 years ago.
After running the installation wizard

Download all attachments as: .zip

Change History (6)

comment:1 by Nicklas Nordborg, 11 years ago

Status: newassigned

comment:2 by Nicklas Nordborg, 11 years ago

I have made some tests and when updating between Reggie 2.12 and 2.13-beta-1 the error message is (see attached image):

Permission denied: The item AnnotationType[id=1164] 
was modified by another transaction.

Full stacktrace in the Tomcat error log:

net.sf.basedb.core.ItemModifiedException: Permission denied: The item AnnotationType[id=1164] was modified by another transaction.
	at net.sf.basedb.core.HibernateUtil.commit(
	at net.sf.basedb.core.DbControl.commit(
	at net.sf.basedb.reggie.servlet.InstallServlet.doGet(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at net.sf.basedb.clients.web.extensions.ServletWrapper.service(
	at net.sf.basedb.clients.web.servlet.ExtensionsServlet.doGet(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.apache.catalina.valves.AccessLogValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.AbstractHttp11Processor.process(
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$ Source)
	at Source)
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): []
	at org.hibernate.persister.entity.AbstractEntityPersister.check(
	at org.hibernate.persister.entity.AbstractEntityPersister.update(
	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(
	at org.hibernate.persister.entity.AbstractEntityPersister.update(
	at org.hibernate.action.EntityUpdateAction.execute(
	at org.hibernate.engine.ActionQueue.execute(
	at org.hibernate.engine.ActionQueue.executeActions(
	at org.hibernate.engine.ActionQueue.executeActions(
	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(
	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(
	at org.hibernate.impl.SessionImpl.flush(
	at org.hibernate.impl.SessionImpl.managedFlush(
	at org.hibernate.transaction.JDBCTransaction.commit(
	at net.sf.basedb.core.HibernateUtil.commit(
	... 24 more

by Nicklas Nordborg, 11 years ago

Attachment: install-wizard-518.png added

After running the installation wizard

comment:3 by Nicklas Nordborg, 11 years ago

The annotation type with id=1164 is the PlateProcessResult annotation. It already exists in Reggie 2.12 but need two modifications in Reggie 2.13

  1. It must be enabled for PHYSICALBIOASSAY items
  2. It must be added to the FlowCell category

The installation wizard will detect 1 and make modifications as necessary on the annotation type.

Then, the installation wizard detects that FlowCell doesn't yet exists and creates it IN A SEPARATE TRANSACTION. The problem is that the extra transaction that creates the category is also used to fix 2. This causes a problem since the main transaction has already modified the annotation type.

The solution to this problem is that the SEPARATE transactions that are used for creating items should NEVER modify any other items. They should only be modified by the main transaction.

After a quick scan of the installation wizard it seems like there are no other places were this is happening. So moving the fix for 2 out to the main transaction seems to solve the problem.

comment:4 by Nicklas Nordborg, 11 years ago

Milestone: Reggie v2.xReggie v2.13

comment:5 by Nicklas Nordborg, 11 years ago

Resolution: fixed
Status: assignedclosed

(In [2080]) Fixes #518: Installation wizard must be run twice

Note: See TracTickets for help on using tickets.