This is regarding Websphere Application Serve, Java Message Service, Message Queue and Listener.
I have a scenario where my listener can have more sessions. So my MDB (message driven bean) can have multiple instances while running on WAS server thread.
My MDB will process/parse the received message and make some db transactions. So if my MDB receives more messages(suppose take 2 messages), MDB will create 2 instances since my listener sessions value has been set to 2 and try to process both messages at same time on the single thread. I have kept a thread.sleep(1000) to hold one message processing while other instance is processing. But both MDB instances are running on same thread, my entire process is on sleep for 1 second and again trying to do both processes parallelly and rollbacking both processes.
Any suggestions on this scenario.