Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
During deletion of rejected studies an exception is thrown:
2023-04-28 15:46:12,462 INFO [org.dcm4chee.arc.iocm.rs.StudyMgtRS] (default task-2) Response Internal Server Error caused by javax.ejb.EJBException: java.lang.IllegalArgumentException: Removing a detached instance org.dcm4chee.arc.entity.UIDMap#21
at org.jboss.as.ejb3@26.1.2.Final//org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:268)
at org.jboss.as.ejb3@26.1.2.Final//org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:408)
at org.jboss.as.ejb3@26.1.2.Final//org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:162)
at org.jboss.invocation@1.7.0.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.invocation@1.7.0.Final//org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
(...)
Caused by: java.lang.IllegalArgumentException: Removing a detached instance org.dcm4chee.arc.entity.UIDMap#21
at org.hibernate@5.3.28.Final//org.hibernate.event.internal.DefaultDeleteEventListener.disallowDeletionOfDetached(DefaultDeleteEventListener.java:196)
at org.hibernate@5.3.28.Final//org.hibernate.event.internal.DefaultDeleteEventListener.performDetachedEntityDeletionCheck(DefaultDeleteEventListener.java:184)
at org.hibernate@5.3.28.Final//org.hibernate.event.internal.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:105)
at org.hibernate@5.3.28.Final//org.hibernate.event.internal.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:72)
at org.hibernate@5.3.28.Final//org.hibernate.internal.SessionImpl.fireDelete(SessionImpl.java:1015)
at org.hibernate@5.3.28.Final//org.hibernate.internal.SessionImpl.delete(SessionImpl.java:951)
at org.hibernate@5.3.28.Final//org.hibernate.internal.SessionImpl.remove(SessionImpl.java:3461)
at org.jboss.as.jpa@26.1.2.Final//org.jboss.as.jpa.container.AbstractEntityManager.remove(AbstractEntityManager.java:658)
at deployment.dcm4chee-arc-ear.ear.dcm4chee-arc-store.jar//org.dcm4chee.arc.store.impl.StoreServiceEJB.removeOrphaned(StoreServiceEJB.java:699)
at jdk.internal.reflect.GeneratedMethodAccessor175.invoke(Unknown Source)
To Reproduce
Steps to reproduce the behavior:
Try permanently delete rejected study.
Expected behavior
I expected deletion of study.
Desktop (please complete the following information):
Additional context
N/A
Proposed solution
In file "org/dcm4chee/arc/store/impl/StoreServiceEJB.java" I suggest to add em.merge() in the method:
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void removeOrphaned(UIDMap uidMap) {
if (countLocationsByUIDMap(uidMap) == 0)
em.remove(uidMap);
}
to attach uidMap to current hibernate session.
After change:
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void removeOrphaned(UIDMap uidMap) {
if (countLocationsByUIDMap(uidMap) == 0)
em.remove(em.merge(uidMap));
}
Beta Was this translation helpful? Give feedback.
All reactions