This content has been marked as final.
Show 3 replies
-
1. Re: bug in session.rollback()
timfox Mar 27, 2009 7:46 AM (in response to ataylor)That's fine there should only ever be one GetRefsOperation per tx.
-
2. Re: bug in session.rollback()
timfox Mar 27, 2009 7:48 AM (in response to ataylor)Probably the real bug is that it's not using the queue from the reference, it's using the owner queue of the inner class, i.e. something like:
void postRollback(LinkedList<MessageReference> refs) throws Exception { synchronized (this) { for (MessageReference ref : refs) { ServerMessage msg = ref.getMessage(); if (!scheduledDeliveryHandler.checkAndSchedule(ref, backup)) { messageReferences.addFirst(ref, msg.getPriority()); } } deliver(); } }
Should really be:void postRollback(LinkedList<MessageReference> refs) throws Exception { synchronized (this) { for (MessageReference ref : refs) { ServerMessage msg = ref.getMessage(); if (!scheduledDeliveryHandler.checkAndSchedule(ref, backup)) { ref.getQueue().messageReferences.addFirst(ref, msg.getPriority()); } } deliver(); } }
-
3. Re: bug in session.rollback()
ataylor Mar 27, 2009 8:09 AM (in response to ataylor)actually the error was this piece of code
if (checkDLQ(ref)) { LinkedList<MessageReference> toCancel = queueMap.get(ref.getQueue()); if (toCancel == null) { toCancel = new LinkedList<MessageReference>(); queueMap.put((QueueImpl)ref.getQueue(), toCancel); } toCancel.addFirst(ref); }
actually it should beif (ref.getQueue().checkDLQ(ref)) { LinkedList<MessageReference> toCancel = queueMap.get(ref.getQueue()); if (toCancel == null) { toCancel = new LinkedList<MessageReference>(); queueMap.put((QueueImpl)ref.getQueue(), toCancel); } toCancel.addFirst(ref); }
We always call the checkDLQ(..) method is always called for the same queue not the queue for the ref.
This explains the errors with the AddressSettings tests I'm currently writing as well.