cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Connector RFC Server issue

Former Member
0 Kudos

Hello!

I have created an RFC Server using the .NET Connector 2.0. The code was generated in VB. When I run it, and then call it from a test program in SE38 that calls it 100 times in a row, it works fine. However, if I run two sessions at the same time and call the RFC Server, one of the SE38 sessions will dump. Can an RFC Server not handle calls from multiple sap callers? Or am I just missing something here?

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Mary,

I'll start by mentioning that I've never used the .NET connector. However, I have used the RFC SDK extensively, upon which the .NET connector is based (ignoring SOAP functionality).

Whilst the RFC library is thread-safe; multi-threading itself is something that must be implemented by yourself.

Specifically, each thread of the program must register itself with the SAP gateway using the same program ID. When you do this, you will get multiple connections appearing with the same program ID in SAP transaction SMGW (IIRC, in 4.6 menu Goto|Logged on clients).

Then, when your ABAP program makes a call to the RFC server, the system looks at the RFC destination, discovers the program ID, looks at the connections registered with that program ID and then selects a connection that is available (meaning, not currently serving another ABAP program).

From the SAP perspective, there is really no difference between a multi-threaded RFC server program and multiple instances of a single-threaded RFC server program. It is purely at matter of implementation for the remote end.

Cheers,

Scott

Former Member
0 Kudos

Thanks, Scott. After reviewing the code more closely, you called the problem exactly...multi-threading implementation on my end. I was trying to write information to a log file without opening it in the proper sharing mode and it was causing a file access violation.

Thanks for your help!