Threading from Java to COM

J-Integra® has been designed to handle multiple simultaneous requests to COM objects from Java.

The J-Integra® runtime DCOM engine will allow multiple simultaneous requests to the same COM object, as well as to different COM objects, and since J-Integra® talks DCOM, and DCOM is layered over DCE RPC, J-Integra® will split large method invocations into multiple RPC PDUs, and reassemble responses that have been split up.

Whether the remote COM object correctly handles multiple simultaneous requests is entirely dependant on its threading model and implementation. For example, there are some issues discussed in Considerations for Server-Side Automation of Office, such as JSP/Servlet accessing Microsoft Excel.

If your Java client is multi-threaded and concurrently accesses a COM reference, then you need to make sure that your Java code contains critical sections to protect the COM reference. For example, the Java method which communicates with the COM component should be a synchronized method. More information about synchronized is available at Sun's the Producer/Consumer Example.