Opened 9 years ago

Closed 9 years ago

#1925 closed defect (fixed)

ObjectNotFoundException when creating a new project default protocol that is replacing an older protocol

Reported by: Nicklas Nordborg Owned by: everyone
Priority: trivial Milestone: BASE 3.4.2
Component: core Version:
Keywords: Cc:

Description

This is more or less the same problem as #1855 but a bit more complicated to reproduce.

  1. Create a project and make it the active project
  2. Create a protocol and add it as a default protocol to the project
  3. Delete the protocol and clean the trashcan
  4. Create a second protocol and add it as the default protocol to the project
  5. Create a third protocol and replace the the existing default protocol. When saving you get an error message like the one below:
No row with the given identifier exists: [net.sf.basedb.core.data.ProtocolData#752318]
org.hibernate.ObjectNotFoundException
...at org.hibernate.internal.SessionFactoryImpl$1$1.handleEntityNotFound(SessionFactoryImpl.java:253)
...at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:262)
...at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:176)
...at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:286)
...at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:185)
...at data.ProtocolData_$$_jvstf1_2.getItemSubtype(ProtocolData_$$_jvstf1_2.java)
...at Project.replaceDefaultItem(Project.java:696)

The ProtocolData#752318 is the id of the first protocol that was deleted.

Workaround is to go to the View -> Projects page and enter the current project. This will automatically remove the link to the non-existing item.

Change History (1)

comment:1 by Nicklas Nordborg, 9 years ago

Resolution: fixed
Status: newclosed

(In [6761]) Fixes #1925: ObjectNotFoundException when creating a new project default protocol that is replacing an older protocol

Note: See TracTickets for help on using tickets.