SAP RFC Call not returning updated table and RFC names
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?
Solution 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.