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

How do I find the jms queue in weblogic?

446


How do I configure jdbc so that the jms jdbc store recovers automatically?

493


What is a topic?

507


What are the different places where you can use the JMS API?

488


Why jms is used in java?

465






Why do we use jms?

426


What is the difference between a queue and a topic?

466


Explain Asynchronous Message Consumption in JMS?

954


In which situations we are using jms?

489


Explain about message listeners?

551


What is wire level protocol?

463


Is ibm mq jms compliant?

424


Is activemq a jms provider?

453


What is jms consumer?

493


What is use of jms?

466