cancel
Showing results for 
Search instead for 
Did you mean: 

JCO_ERROR_CONCURRENT_CALL

Former Member
0 Kudos

Hello,

I created a small Java-Application with JCO. There is a JFrame. Inside the JFrame is a Exit-Button. The action behind the button closes the connection und exits the Application.

The program creates a Connection to Sap with the Parameter setSapGui(2). So I can start the Sap-Dialog.

When the Sap-Gui is started and the user uses the exit-button, there is JCO_ERROR_CONCURRENT_CALL-Exception. (JCO_ERROR_CONCURRENT_CALL: Connection cannot be disconnected. Connection currently used in another thread.)

When I use System.exit(0) in the exit-Action, then the Java-Window will be closed but the Sap-Gui stays open.

Ok, I understand that the Sap-GUI uses the connection. But is there a way to kill the Sap-Gui in Java?

Regards

Michael

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Look at the parameters you pass when creating the JCO connection. You do not want to check the SAPGUI option. Checking the SAPGUI option will cause the session to be reflected or echoed to SAPGUI? (never used that option myself)

Anyway most of the time sapgui will not even be present on the machine executing the java code...

Enjoy

Former Member
0 Kudos

Hi Michal,

visit this /message/291853#291853 [original link is broken].

here is post by Portal Developer in that thread...

the Jco Java Doc says:

JCO_ERROR_CONCURRENT_CALL A concurrent method call has been detected

I would assume there is a collision because of improper thread synchronization. Maybe you access the same JCO connection, eg method execute, from different threads. Putting calls to JCO connections into synchronize statements might help.

Hope it helps you.

Regards,

Narinder Hartala