@Nigel ASFAIR throwing an exception from MDB results in rollback and
redelivery of message, so i do not get what do you mean by "redelivery by
the client" and why it should differs from rolling back an exception. Do
you feel that one can rely on redelivery order to implement it correctly?
In case message 2 and message3 are rollbacked, what is a guarantee that
they are redelivered in the same order ?
br Jakub
W dniu 9 marca 2012 12:26 użytkownik Nigel Deakin
<nigel.deakin_at_oracle.com>napisał:
> Patrick,
>
> OK. I suspect what may be happening is that when you roll back the
> transaction, the broker is redelivering message 1. However messages 2 and 3
> are already cached in the client, ready to deliver to your MDB, and are
> therefore getting processed first.
>
> It might be worth experimenting with your MDB throwing an exception rather
> than rolling back the transaction. Then the message may be redelivered by
> the client rather than the broker, which would prevent it losing its place
> in the message order.
>
> (If message 2 and 3 also roll back the transaction because the shopping
> cart is not yet created then I would expect these to be redelivered after
> message 1, thereby maintaining the correct order.)
>
> I presume you are using GlassFish MQ and the default resource adapter. If
> you're using anything else please say so.
>
> Nigel
>