cancel
Showing results for 
Search instead for 
Did you mean: 

How to have the JTA transaction in ServiceEndpoint interface java method

Former Member
0 Kudos

Hi,

I have query how to have the JTA transaction in SEI(Service endpoint interface) generated by WSDL.

I have a MDMListener (using MDM API) which looks for a recordchange in MDM repository which needs to be send to PI7.1 via soap request.

1) I had imported the WSDL from ESR(PI) and generated outside-in proxy.

2) Created ejb3.0 stateless session bean using NWDS

3) Created web service client application by generating the WSDL again (by Generate client)

4)Added a method callPI()with Service and i set the context with endpointaddress property as the soap location of the sender agreement configured in PI7.1.

The damean thread listener(EventDispatcher) looks for MDM record change and it calls the method callPI() from ejbsession bean by lookup to transfer the record to PI7.1 system via webservices(web method). I hit the below error.

Exception com.sap.engine.services.ts.exceptions.BaseIllegalStateException: Status of ( SAP J2EE Engine JTA Transaction : 06223ffffffa20048fffffffe ) should be active, but it is STATUS_COMMITTED = 3.

at com.sap.engine.services.ts.jta.impl.TransactionImpl.registerSynchronizationWithoutStatusChecks(TransactionImpl.java:672)

at com.sap.engine.services.ts.jta.impl.TransactionImpl.registerSynchronization(TransactionImpl.java:641)

at com.sap.engine.services.ts.transaction.TxLevelSynchronizations.addSynchronization(TxLevelSynchronizations.java:118)

at com.sap.engine.services.ts.transaction.TxManagerImpl.registerSynchronization(TxManagerImpl.java:829)

at com.sap.transaction.TxManager.registerSynchronization(TxManager.java:303)

at com.sap.engine.messaging.runtime.j2ee.sapengine.SAPTransactionManager.registerSynchronization(SAPTransactionManager.java:126)

at com.sap.engine.messaging.impl.util.tx.TxController.<init>(TxController.java:83)

//Method in the ejb stateless session bean

@WebServiceRef (name="DistributeMasterDataService") DistributeMasterDataService service;

@RelMessagingNW05DTOperation(enableWSRM=true)

public void callPi(DistributeMasterDataRequestType req) {

.........................

.........................

port.distributeMasterDataOutA(req);// the distributeMasterDataOutA is the method available in SEI..Here is the issue on JTA

.........................

.........................}

For the first time the message(req object)transmits to the PI successfully,but for the second call i hit this JTA Transaction :status should be active, but it is STATUS_COMMITTED = 3.

I tried chanding the transactionmanagement from container to bean.

@TransactionManagement(value=TransactionManagementType.BEAN)

@TransactionAttribute(value=TransactionAttributeType.REQUIRES_NEW)

I wanted to know how can i have the JTA transaction status in SEI(service enpoint interface)java method distributeMasterDataOutA.Since it is an interface i dont know what annotation can be used.

If its possible i can try this UserTransaction,

http://help.sap.com/saphelp_nw04/helpdata/de/f6/7a8df922db4ab79342b46c48dac7d0/content.htm

ut.begin() & ut.commit(),so that everytime this method is called it will treat as a new transaction..

Let me know if you need more details??,Any idea provided would be great.

Thanks

Sabarinathan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello everybody,

The issue resolved,we need to have the bean management transaction type and not the container.

and the transactionattribute value as Requires New

rgds

Sabarinathan

Edited by: Sabarinathan Selvaraj on May 12, 2009 2:17 PM