cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Table optimistic lock when using JRA

0 Kudos

Hi Everyone,

I am trying to develop some existing Webdynpro Java applications in Java using the spring framework.

I am using the JRA to connect with the SAP System. I understand from forums that JRA internally use the Jco connection to the SAP Backend systems.

Currently we have a situation that the locks will be created for the users when they execute some RFC and the locks will be deleted automatically when the users session is deleted. This is done to avoid other users to edit when someone is already editing it.

I am not able to achieve this when I use the JRA. Here, even though I am not closing the connection, it closes the SAP session and deletes the locks immediately after execution of RFC.(is it because there is no control over the JCo user session?)

What I want to know is that, is there any way to retain the session so that the locks will be persistent. or I have no control over the session if I use the JRA so I have to use the JCo apis.

Thanks

Anoop

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

when we execute the RFC, JRA internally creates a new Jco Client and executes the RFC using that client and disconnect the client after execution.

disconnect the JcoClient means that closing the Session. So As per SAP locking mechanism, it deletes all the locks which were created under that session.

What I want to know here is about any method using I can control the JCos

Thanks

Anoop

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Anoop,

in order to keep the connection, you simply need to execute all requests in the context of a local transaction.

Best regards,

Markus

former_member193379
Active Contributor
0 Kudos

Hi Anoop,

In line with Markus and we can control transactions by using JTA too.

Thanks,

Hamendra

Answers (0)