Why is durableRefCount decremented in a transaction *before* it is committed?
Surely it should be decremented when it is committed?
int count = message.decrementDurableRefCount();
This is something you originally wrote, but it seems correct to me.
You need that to determine if you are going to delete the message on the same transaction.
If rollback is called, the delete won't take effect and the durable will be reverted.
Maybe you thought about a different way of doing it now.