Hi,<br><br>I wonder if it is possible to do these two things in CORBA server that uses omniORB:<br><br>1. wrap every incoming call with smth like:<br>try {<br>... // process call<br>} catch(std::exception const&amp; x) {<br>
   throw MyCorbaException(x.what());<br>}<br clear="all"><br>the idea is to replace CORBA_Unknown exceptions generated by escaped C++ exception with something more useful... Obviously this code should be executed in context of a thread that actually processes the request.<br>
I have checked interceptors in the documentation but it is very brief and does not give any guarantees on thread context given interceptor will be called in.<br><br>2. this one is very similar to (1) but not required to happen on request processing thread -- essentially I need to set a flag before processing a request and reset it when it returns. This is going to be used in conjunction with MAIN_THREAD_MODEL and it is important that flag for given request is not set before previous request finish processing... and once flag is set next request to be processed should be &quot;ours&quot;. Ideally I would like this to work like in (1), but alternatively I can use global mutex:<br>
- in receive request interceptor -- lock mutex, set flag, proceed<br>- in reply interceptor (assuming that it is guaranteed to be called, even if &quot;proceed&quot; step fails before actually reaching user code) -- reset flag, unlock mutex<br>
But I am not sure if it is ok to lock mutexes in interceptors (and if it is ok with MAIN_THREAD_MODEL).<br><br>That&#39;s it... I am looking for a solution that will work regardless of current threading model and other configuration options and would be nice to have this at the POA granularity level (i.e. to be able to do it for requests server by specific POA -- but it is optional).<br>
<br>If someone could point me into proper direction -- it would be great. Thank you.<br>-- <br>Sincerely yours,<br>Michael.<br>