Why do the TopicSession.createDurableSubscriber and TopicSession.unubscribe calls raise JMSException with the message "ORA - 4020 - deadlock detected while trying to lock object"?

Answer Posted / munnu

CreateDurableSubscriber and unsubscribe calls require exclusive access to the Topics. If there are pending JMS operations (send/publish/receive) on the same Topic before these calls are issued, the ORA - 4020 exception is raised.

There are two solutions to the problem:

1. Try to isolate the calls to createDurableSubscriber and unsubscribe at the setup or cleanup phase when there are no other JMS operations happening on the Topic. That will make sure that the required resources are not held by other JMS operational calls. Hence the error ORA - 4020 will not be raised.

2. Issue a TopicSession.commit call before calling createDurableSubscriber and unsubscribe call.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is mean by jms?

475


What are the steps to send and receive JMS message ?

992


What is the difference between Jms and Jvt ?

529


What is message listener container?

461


What is a remote jms provider?

502






What is the functionality of a jms message selector?

488


Is jms a protocol?

474


What is jms protocol?

465


What is jms used for?

499


What is a jms listener?

467


Can we use jms for sending automated e-mails?

523


What is jms and mq?

467


How do I use a startup class to initialize and later reference jms objects?

434


What is a queued message?

458


Explain Asynchronous Message Consumption in JMS?

960