In our receiver method:
h.handle(message);
} catch (Throwable e) {
logger.error("Error in handling message", ExceptionUtils.getRootCause(e));
MessageProcessingErrorEvent mpe = new MessageProcessingErrorEvent(userManagement.getUserBusUnitGuid(),
e);
mpe.send();
throw new XmRuntimeException(e.toString(),e);
}
The sending of the event fails because we look up the user's busUnitGuid and this requires a transaction. The receiver method is being run in a transaction itself.
I thought one solution to this problem would be to put SUPPORTS transaction attribute on the getUserBusUnitGuid() method. The SUPPORTS attribute says that it will go under a transaction if one is present, otherwise it will run without a transaction.
It didn't fix the problem though, it was still saying that the transaction was inactive. Probably JBoss realised there was a transaction attached, so tried to use it, but then discovered it was inactive.
No comments:
Post a Comment