Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Bug #1052 (closed)

Opened 16 years ago

Closed 16 years ago

Session concurrency failure

Reported by: jamoore Owned by: jamoore
Priority: blocker Cc: carlos
Sprint: n.a.
Total Remaining Time: n.a.

Description (last modified by jmoore)

Concurrent logins can cause strange and nondeterministic failures including:

org.springframework.orm.hibernate3.HibernateSystemException: Exception occurred inside getter of ome.model.meta.Experimenter.annotationLinks; nested exception is org.>
        at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661)
        at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
        at ome.logic.QueryImpl.findByString(QueryImpl.java:287)
        at ome.logic.AdminImpl.userProxy(AdminImpl.java:228)
Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: ome.model.meta.Event.experimenter
        at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
        at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:186)
ome.conditions.InternalException:  Wrapped Exception: (org.springframework.dao.InvalidDataAccessApiUsageException):
object references an unsaved transient instance - save the transient instance before flushing: ome.model.meta.Event; nested exception is org.hibernate.TransientObject>
        at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:636)
        at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
        at ome.security.basic.EventHandler.saveLogs(EventHandler.java:228)
        at ome.security.basic.EventHandler.invoke(EventHandler.java:114)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMe

and

Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "eventlog" violates foreign key constraint "fkeventlog_event_event"
  Detail: Key (event)=(105123) is not present in table "event".
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:307)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)

among others.

Attachments (1)

concurrency_test.py (2.1 KB) - added by jmoore 16 years ago.
Test to reproduce the issue from Carlos

Download all attachments as: .zip

Change History (3)

Changed 16 years ago by jmoore

Test to reproduce the issue from Carlos

comment:1 Changed 16 years ago by jmoore

  • Description modified (diff)

comment:2 Changed 16 years ago by jmoore

  • Resolution set to fixed
  • Status changed from new to closed

r2672 closes.

Though there were several issues which needed to be fixed (like the readOnly status of SessionManager methods -- r2668), the main problem causing this was the InheritableThreadLocal in CurrentDetails.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.68265 sec.)

We're Hiring!