cancel
Showing results for 
Search instead for 
Did you mean: 

Exception while trying to use transction in JCA code

former_member182374
Active Contributor
0 Kudos

Hello Experts,

I'm trying to use transaction in my JCA code according to this example: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/dd/1e044258bdd417e10000000a1550b0/content.htm

When I'm trying to get the LocalTranstion object (connection.getLocalTransaction().begin()), I get the following exception:


java.lang.UnsupportedOperationException: The SAP Connector does not supports transactions.

    at com.sapportals.connectors.SAPCFConnector.connection.SAPCFConnectorConnection.getLocalTransaction(SAPCFConnectorConnection.java:176)

J2EE version is 7.01 SP16.   

How can I use transaction from JCA code?

Regards,

Omri

Accepted Solutions (1)

Accepted Solutions (1)

HAL9000
Product and Topic Expert
Product and Topic Expert
0 Kudos

You are mixing up several things here.

JCA - the J2EE Connector Architecture - is a specification, a standard Java Enterprise API which can be implemented by appropriate J2EE connectors. The JRA (SAP Java Resource Adapter) is one of those implementations and offers standard JCA compliant APIs for communicating with an SAP ERP back-end system.

So it's not a question of JRA or JCA! JRA is an implementation of the JCA specification. And JRA also supports the JTA specification (Java Transaction API) with some limitations. This is also the documentation that you have posted a link to.

When looking at your error message, the thing is that you do NOT use the JRA, but some other JCA compliant J2EE connector implementation: the SAPCFConnector. I don't know that much about this connector, I think the abbreviation stands for "SAP Connector Framework Connector" and is usually used in SAP Portal development environments together with appropriate code generators and such stuff. But obviously this connector does not support the JTA specification. At least this is what the error message says.

So if you really need to use the JTA, I think the SAPCFConnector is not an option then. If feasible, please use the JRA for SAP back-end system connectivity instead.

Best regards,

Stefan

former_member182374
Active Contributor
0 Kudos

Hi Stefan,

The missing piece of the puzzle for me was that SAPCFConnector is a different implementation which doesn't support transactions.

I'll try to use JRA (I've used it in 7.3/7.4 but not for 7.01 - I'll look for documentation).

Thanks,

Omri

HAL9000
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Omri,

you already found the JRA online documemtation of release 7.01.

The basic APIs are the same for release 7.3/7.4 and 7.01. The JCA specification defines the API.

The main difference between JRA in release 7.0x and JRA in releases >= 7.10 is, that the first one only implements the JCA specification 1.0 whereas the latter one implements the JCA specification 1.5. That means that especially the capability of doing outbound Remote Function Calls (ABAP to Java) has been added. WIth the older JRA 7.0x you can only do inbound Remote Function Calls (Java to ABAP).

Best regards,

Stefan

former_member182374
Active Contributor
0 Kudos

Hi Stefan,

My problem is the "strange" configuration for JRA in older J2EE versions (deploy tool etc).

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3...

I guess that for my scenario the most simple solution is to wrap the ABAP function in a new function and call the COMMIT action from the wrapper function (in this way I'm calling only one function and transaction is not needed).

Regards,

Omri

Answers (1)

Answers (1)

former_member182374
Active Contributor
0 Kudos

After reviewing the link again it's related to JRA and not JCA (the API is very similar) but the question still stands: how to use transaction in JCA