yes or no? Thanks
Can you elaborate on your question? Is using the Enterprise API safe? Or is using Thread within Enterprise Server safe? And safe for what?
i want to implement the wm api with ejb to make broker call. however, j2ee spec indicates that the ejb must not create a new thread when making calls otherwise unexpected result may rise within the app server.
if i implement the wm enterprise api within ejb, is it safe for the app server? will the ejb create a new thread when connecting to broker?
You will be safe using the WM api call from an EJB as long as you don’t spawn a new thread of control to handle the WM call. We have successfully been using a BrokerClient connection via an EJB (BEA WebLogic 6.1) to communicate from the App Server to WM Enterprise Server for over a year now with no problem. The call is made as part of a normal method on the Bean, no new threads are needed.
I believe the spec publishes this warning because the EJB is under the App Server’s control and can be DeActivated from the JVM and serialized and reloaded as a whole new instance on the next Activation. If you are relying on communications between a spawned thread and the EJB, this behavior could cause unexpected results.
Thanks for the reply. The reason I am asking this is because we implemented a EJB with brokerclient connection (no new thread was created within EJB) and the app server was leaking memory. We noticed that the EJB was spawing thread. When we digged deeper we found out the brokerclient connection was actually spawing a thread. Last year we were told by wM it was safe to implement wM API within EJB and it would not create thread. This morning, we got a confirmation from the wM that the API, for instance brokerclient connection, does spaw a new thread that block on a call to read the socket connected to the Broker. Although the EJB has been running a couple of months without any problem, but it did after all. It was like a time bomb. The wM API methods are spawing thread and the EJB is calling them, which is highly not recommended. Keep your finger cross
We are thinking to move to the wM JCA connector, specially for EJB.
We are using a transient connection strategy so we are not maintaining an open connection to the broker. We connect, deliver the event and disconnect so maybe this is why we are not seeing any problems. Thanks for the more detailed info though, it is good to know that detailed information.
Steve, can you elaborate your approach? I am interested in knowing more. My question to you is that does your EJB uses wM API to make broker connection at all? I am not familiar with transient connection. Thanks.