What i mean is that with QueueSession session = conn.createQueueSession(true, -1); u create a transacted session. But what does that mean besides that u could commit or rollback a series of messages? It also mean that we have a serial order for those messages. It means that till i commit the session i guess i'm guaranted that no other messages will interviene with my the group i;m creating now. So does that imply some sort of locking and other threads trying to start a transacted session have to wait for this one to finish? When does the lock actualy begin, because we don't pass a destination in the createQueueSession, and there shouldn't be any blocking with threads accesing different destinations.
So does a lock start with QueueSender senderJMS = session.createSender(queue); and other threads trying to send to that destination have to wait? Or it doesn;t actually imply that they block, and only when we call commit() on the session the whole group is sent but as a whole and it doesn't matter who starts first a transacted session as they never block each other even on the same destination, and only the first who calls commit gets his group of messages there first. [ June 10, 2005: Message edited by: Balamaci Serban ]
It simply means that it makes sure the message is delivered to the message queue. However, unless you committed your current transaction, those message will not be delivered to message consumers. In other words, those messages stays in the message queue until you committed your current transaction. If you abort, those message will be removed from queues. [ June 13, 2005: Message edited by: Jeremy Hsu ]
Joined: Mar 16, 2005
Thanks, i guess it had to be so, after all, u use JMS to get away from having to block waiting for a message to be delivered.