Closed SergeyLee closed 7 years ago
This issue is a new feature for SBB passivation in some use cases.
Now SBB passivation works only for sbbEntity when it is not null and its sbbObject is not null:
https://github.com/RestComm/jain-slee/blob/2.x/container/router/src/main/java/org/mobicents/slee/runtime/eventrouter/routingtask/EventRoutingTaskImpl.java#L540-L543
The solution is passivation of all SBB Entities in the transaction context if the sbbObject is not null.
... sbbEntity.passivateAndReleaseSbbObject(); final Collection coll = txMgr.getTransactionContext().getData().keySet(); final SbbEntityID ongoingEntID = sbbEntity.getSbbEntityId(); TransactionalAction removeLoadedSBBAction = new TransactionalAction() { @Override public void execute() { for (Object obj : coll) { if (obj instanceof SbbEntityID) { if (!obj.equals(ongoingEntID)) { SbbEntity currentEntity = (SbbEntity) txMgr.getTransactionContext().getData().get(obj); if (currentEntity.getSbbObject() != null) { currentEntity.passivateAndReleaseSbbObject(); } } } } } }; txMgr.getTransactionContext().getBeforeCommitPriorityActions().add(removeLoadedSBBAction); ...
This issue is related to issue #41.
Why: "if (!obj.equals(ongoingEntID)) {" ?
Because ongoingEntID is
final SbbEntityID ongoingEntID = sbbEntity.getSbbEntityId();
and we already passivate sbbEntity.
This issue is a new feature for SBB passivation in some use cases.
Now SBB passivation works only for sbbEntity when it is not null and its sbbObject is not null:
https://github.com/RestComm/jain-slee/blob/2.x/container/router/src/main/java/org/mobicents/slee/runtime/eventrouter/routingtask/EventRoutingTaskImpl.java#L540-L543
The solution is passivation of all SBB Entities in the transaction context if the sbbObject is not null.