[jBPM] - using JTA Transactions in jBPM 3
by Sascha Janz
Sascha Janz [https://community.jboss.org/people/AJanz] created the discussion
"using JTA Transactions in jBPM 3"
To view the discussion, visit: https://community.jboss.org/message/833238#833238
--------------------------------------------------------------
Hello,
we are still using jBPM 3.2.3. ( seam and richfaces for frontend )
Due to some data inconsistencies between jBPM and our data, i wanted to use JTA Transactions to get control over commit and rollback.
although i read the documentation i am not quite sure how to use it the right way.
in jbpm.cfg.cml isTransactionEnabled must still set to false, is that right ?
in hibernate.cfg.xml i change to JTA
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
Now i want to set the commit and rollback points in our code. i wrote a simple class TransactionManager with three methods "beginTransaction" , "commitTransaction" and "rollbackTransaction".
every method in our code with write access, i extended with these three methods.
beginTransaction does the following
[code]
// creating new context and store in a ThreadLocal
jbpmContextThreadLocal.set(cfg.createJbpmContext());
// on this context start a hibernate transaction
Transaction tx = jbpmContextThreadLocal.get().getSession().beginTransaction();
// and store it also in a ThreadLocal
userTransactionThreadLocal.set(tx);
[/code]
commitTransaction
[code]
userTransactionThreadLocal.get().commit();
userTransactionThreadLocal.remove();
// explizites flush!
// s. unter http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/... http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/...
jbpmContextThreadLocal.get().getSession().flush();
jbpmContextThreadLocal.get().close();
jbpmContextThreadLocal.remove();
[/code]
and rollback
[code]
userTransactionThreadLocal.get().rollback();
userTransactionThreadLocal.remove();
jbpmContextThreadLocal.get().close();
jbpmContextThreadLocal.remove();
[/code]
is this a right way to use JTA Transaction with jBPM ?
or am i doing something wrong?++
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/833238#833238]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 3 months
[JBoss Web Services] - [org.apache.cxf.ws.rm.RMInInterceptor] (default task-57) WS-ReliableMessaging is required by this endpoint.
by Joseph Hwang
Joseph Hwang [https://community.jboss.org/people/aupres] created the discussion
"[org.apache.cxf.ws.rm.RMInInterceptor] (default task-57) WS-ReliableMessaging is required by this endpoint."
To view the discussion, visit: https://community.jboss.org/message/833066#833066
--------------------------------------------------------------
With WildFly Alpha 4, I try to implement Java Web Service.
This is my Web Services Interface,
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;
import javax.xml.ws.soap.Addressing;
import org.jboss.ws.api.annotation.PolicySets;
@WebService(
name="HelloWorldPort",
portName="com.aaa.ws.IHelloWorld",
serviceName="HelloWorldService",
targetNamespace=" http://www.aaa.com/ http://www.aaa.com")
@SOAPBinding(style=Style.DOCUMENT, use=Use.LITERAL, parameterStyle=ParameterStyle.BARE)
@Addressing(enabled=true, required=false)
@PolicySets({"WS-RM_Policy_spec_example", "WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt"})
public interface IHelloWorld {
@WebMethod(operationName="callNameMethod")
@WebResult(name="helloEcho")
public String sayHello(@WebParam(name="helloName", mode=WebParam.Mode.IN) String name);
}
Deployment is successful, But When calling ws interface, Exception is thrown
[org.apache.cxf.ws.rm.RMInInterceptor] (default task-57) WS-ReliableMessaging is required by this endpoint.
Pls, I need your advice!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/833066#833066]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 3 months