Did I omit something in my description or the information I provided is not sufficient for the case?
Thanks for your help.
I'm not sure whether you can change the behaviour as you wish.
One option might that you ack the message in your code. Other option might be the transactional behviour.
Can you suggest me the API which i have to look at for sending acknowledgement or how to change the transactional behaviour
If you use MDB's the transaction can be declared at the onMessage method by descriptor or annotation (e.g. XDoclet if you use EJB2.1).
If you use a client you decide by creating the session connection.createSession(boolean transactional, Session.CLIENT_ACKNOWLEDGE) [or AUTO_ACK, TRANSACTED].
See javadoc of the methods.
In our application we are using MDB's with EJB 2.0 can you suggest us some API's or examples by which we can create transaction. We tried to set acknowledgement mode to CLIENT_ACK but we came to know that only AUTO_ACK and DUPS_OK are the only supported modes if we use MDB.