User Story #1423 (closed)
Opened 15 years ago
Closed 14 years ago
User can query for which objects have been deleted.
Reported by: | jamoore | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | OMERO-Beta4.2.1 |
Component: | ORM | Keywords: | n.a. |
Cc: | carlos@… | Story Points: | n.a. |
Sprint: | n.a. | Importance: | n.a. |
Total Remaining Time: | 0.0d | Estimated Remaining Time: | n.a. |
Description (last modified by jmoore)
Problem
Any use of org.hibernate.Query.executeUpdate will NOT cause an EventLog to be created, and therefore may should be avoided.
$ find omero.git/ -name "*.java" -exec grep executeUpdate {} /dev/null \; omero.git//components/blitz/src/ome/services/blitz/fire/Ring.java: this, "executeUpdate - set closed = now()") { omero.git//components/blitz/src/ome/services/blitz/fire/Ring.java: return q.executeUpdate(); omero.git//components/blitz/src/ome/services/blitz/fire/Ring.java: return q.executeUpdate(); omero.git//components/server/src/ome/services/delete/DeleteBean.java: count = q.executeUpdate(); omero.git//components/server/src/ome/services/delete/DeleteBean.java: count = q.executeUpdate(); omero.git//components/server/src/ome/services/delete/DeleteBean.java: count = q.executeUpdate(); omero.git//components/server/src/ome/services/delete/DeleteBean.java: count = q.executeUpdate(); omero.git//components/server/src/ome/services/delete/DeleteBean.java: count = q.executeUpdate(); omero.git//components/server/src/ome/services/delete/DeleteBean.java: q.executeUpdate(); omero.git//components/server/src/ome/services/sessions/SessionManagerImpl.java: // Not performed! Session s = executeUpdate(sf, oldsession, omero.git//components/server/src/ome/services/sessions/SessionManagerImpl.java: Session s = executeUpdate(sf, oldsession, userId); omero.git//components/server/src/ome/services/sessions/SessionManagerImpl.java: return executeUpdate(sf, copy, newctx.getCurrentUserId()); omero.git//components/server/src/ome/services/sessions/SessionManagerImpl.java: private Session executeUpdate(ServiceFactory sf, Session session, omero.git//components/tools/OmeroImporter/src/ome/formats/importer/HistoryDB.java: int i = st.executeUpdate(expression); // run the query
Solution
The solution requiring the least server modifications is to move all creation of delete EventLogs into the database as triggers.
Something similar was added for catching annotation modifications in #1390.
Change History (8)
comment:1 Changed 15 years ago by jmoore
- Milestone changed from OMERO-Beta4.1 to OMERO-Beta4.2
comment:2 Changed 15 years ago by jmoore
The same goes for any thing modified from psql. Note: such changes will ultimately cause lucene (and possibly other processes) to get out of sync. The best solution may be to add triggers at the DB level, so that any modifications will automatically create an EventLog? (this assumes an Event being present which complicates matters.)
comment:3 Changed 14 years ago by jmoore
- Keywords cleanup added
- Milestone changed from OMERO-Beta4.2 to Unscheduled
comment:4 Changed 14 years ago by jmoore
- Type changed from Task to User Story
Changing to story to be a part of the delete refactoring requirement (#2615) This most likely entails adding triggers for all changes.
comment:5 Changed 14 years ago by jmoore
comment:6 Changed 14 years ago by jmoore
- Description modified (diff)
- Keywords cleanup removed
- Milestone changed from Unscheduled to OMERO-Beta4.2.1
- Summary changed from org.hibernate.Query.executeUpdate does not publish events to User can query for which objects have been deleted.
comment:7 Changed 14 years ago by jmoore
- Owner jmoore deleted
comment:8 Changed 14 years ago by jmoore
- Resolution set to fixed
- Status changed from new to closed
Any other work on the reporting will have to be done as part of #2911. Closing.
Can't be fixed for 4.1. Carlos, what will you need in the way of a workaround?