For V5.0 and V5.1:
You must create your own mechanism to ensure that messages are not lost
completely if a transaction rollback occurs in the EJB. One possible
solution is to use a JAX-RPC handler to backup messages that are being
processed.
If one-way messaging is used, the application developer must devise
methods to recover and keep track of messages that cause the rollback.
There is no possibility of using a backout queue.
For 6.0:
Install
Fix Pack 9 (V6.0.2.9) or above to allow the message-driven bean
and the EJB to be in the same transaction. If you are running the web
service client in WebSphere Application Server, you can set the property
Constants.ENABLE_TRAN_ONEWAY on the Call or Stub objects.
// Example begins
import com.ibm.websphere.webservices.Constants;
import javax.xml.rpc.Call;
import javax.xml.rpc.Stub;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
import java.util.Properties;
// Example 1
// DII programming model using Call object
//
ServiceFactory factory = ServiceFactory.newInstance();
QName svcQname = new QName(YOUR_TEST_NS, "yourService");
Service svc = factory.createService(svcQname);
QName portQname = new QName(YOUR_TEST_NS, "yourPort");
Call call = svc.createCall(portQname);
...
call.setProperty(Constants.ENABLE_TRAN_ONEWAY, new Boolean(true));
...
// Example 2
// Using static stub programming model
//
Properties prop = new Properties();
InitialContext ctx = new InitialContext(prop);
Service service =
(Service)ctx.lookup("java:comp/env/service/yourService");
Bean yourBean = (Bean)service.getPort(portQname, Bean.class);
((Stub)Bean)._setProperty(Constants.ENABLE_TRAN_ONEWAY,new
Boolean(true));
// Example ends
|