activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gali_ka <gkane...@cisco.com>
Subject race condition in handling connection errors
Date Wed, 16 Jan 2008 13:19:07 GMT

we have an c++ application using activemq.
As we understand, in case of broken connection we can get a signal about it
from two places:
1. we try to send and get an exception in our thread
try
{
    producer.send(..);
}
catch(CMSException&){..}
2. onException() - that will be proceeded from another thread (activemq
listener thread).
We see a possibility for a race condition in handling the error.
If we get the exception in our thread we would like to close the connection
and to delete the connection objects and resources, but as we do it, the
onException() may be just called in another thread. 
The question is whether we understand the situation correctly and the race
condition is possible and we should write the synchronization code.
Thanks


-- 
View this message in context: http://www.nabble.com/race-condition-in-handling-connection-errors-tp14880650s2354p14880650.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message