0

I am working on a .NET application to call SAP RFCs using the SAP JCo3 libraries.

It works and everything is fine, but we've recently had a client reach out to us to tell us that when they change a RFC Table name or add a Table our application does not receive the updates.

They have to restart our application completely to be able to receive fresh data. Our app does not do any kind of caching or anything and I think it might be in the SAP JCo 3 libraries that it's happening and I'm looking for advice, help or information.

I do notice on the RfcDestinationManager there is a method called RemoveFromCache and I'm wondering if that might be usefull.

I also notice in our code we have a public static instance of IDestinationConfiguration on which we call an UpdateDestination function that in turn raises the ConfigurationChanged event.

Do we need to call the ShutdownHook on the RfcDestinationManager or something perhaps?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Quintonn
  • 770
  • 8
  • 29
  • `when they change a RFC Table name or add a Table` what means "change name"? of course when they change table name you app cannot guess the new name out of nowhere, you should tell it. Most probably you should restart the RFC session to receive the updated metadata – Suncatcher Jan 24 '22 at 16:49

1 Answers1

1

you probably mean NCo, not JCo. JCo is the Java connector, NCo the .Net connector. It sounds like you're talking about changes to RFC function module interfaces, meaning the customer is transporting something to his production system and your application dynamically evaluates function parameters but doesn't pick up the changes.

The metadata of RFC functions is cached in the RfcDestination.Repository object (type RfcRepository). That class has a function ClearAllMetadata() that you could use to flush the NCo cache. I haven't found any online documentation to the NCo API, but it is mentioned in the .chm documentation that comes with NCo.

It might have a significant performance impact if you call this every time you talk to the RFC Server though. So you may want to flush the metadata on a schedule to reduce the performance impact.

Dirk Trilsbeek
  • 5,873
  • 2
  • 25
  • 23
  • yes, NCo sorry. We also work with JCo in Java hence the confusion. I will see if these methods exist in my code and if they fix the issue. – Quintonn Jan 15 '22 at 20:00