Opened 10 years ago

Closed 10 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:
Cc:

Description

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 10 years ago.
After running the installation wizard

Download all attachments as: .zip

Change History (6)

comment:1 by Nicklas Nordborg, 10 years ago

Status: newassigned

comment:2 by Nicklas Nordborg, 10 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(HibernateUtil.java:1177)
	at net.sf.basedb.core.DbControl.commit(DbControl.java:492)
	at net.sf.basedb.reggie.servlet.InstallServlet.doGet(InstallServlet.java:423)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at net.sf.basedb.clients.web.extensions.ServletWrapper.service(ServletWrapper.java:82)
	at net.sf.basedb.clients.web.servlet.ExtensionsServlet.doGet(ExtensionsServlet.java:147)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [net.sf.basedb.core.data.AnnotationTypeData#1164]
	at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1950)
	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2594)
	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2494)
	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2821)
	at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:113)
	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185)
	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
	at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
	at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
	at net.sf.basedb.core.HibernateUtil.commit(HibernateUtil.java:1168)
	... 24 more

by Nicklas Nordborg, 10 years ago

Attachment: install-wizard-518.png added

After running the installation wizard

comment:3 by Nicklas Nordborg, 10 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, 10 years ago

Milestone: Reggie v2.xReggie v2.13

comment:5 by Nicklas Nordborg, 10 years ago

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.