Hi,
I have a entity that is in relation with some other entities with cascade type 'remove'.
When I call an action from website to remove (entityManager.remove(userQuery);) an specific entity all other entities are also removed as expected.
But if the same is called inside an asynchronous method only the first entity is removed(userQuery in this case).
Here the quartz scheduled class
@Name("processor") @AutoCreate public class ReportProcessor { @In EntityManager entityManager; @Logger Log log; @Asynchronous @Transactional public QuartzTriggerHandle scheduleDeleteReport(@Expiration Date when, UserQuery userQuery) { userQuery = entityManager.merge(userQuery); log.info("[#0] Processing userQuery #1", System.currentTimeMillis(), userQuery.getId()); if (userQuery.getActive()) { entityManager.remove(userQuery); } return null; } }
@OneToMany(mappedBy="userQuery", cascade=CascadeType.REMOVE)
If you can file a JIRA issue with an example and steps to reproduce, that would be great!