cancel
Showing results for 
Search instead for 
Did you mean: 

NCO 3 Instability Problems (Too many metadata calls)

Former Member

When using the RfcDestination.Repository.CreateFunction method the SAP .NET Connector 3 will read all necessary metadata information from the SAP server represented by the RfcDestination. That metadata information is cached in the repository for future calls (in the CachedAbapObjectMetadata, CachedFunctionMetadata, CachedStructureMetadata and CachedTableMetadata fields of the RfcRepository class). This works well except when using the SAP .NET Connector 3 in a web application hosted in IIS because objects in memory will be lost when IIS recycles the application, which in turn will result in all cached metadata being lost.

Re-reading the meta data for every RFC call has caused some instability since the SAP server and IIS server aren't co-located and are connected over the Internet. We'd like to read the metadata from the server once during the setup of the application, store it, then manually add metadata to a repository, but if we add a RfcFunctionMetadata object to the CachedFunctionMetadata collection of a RfcRepository it doesn't do anything, the CachedFunctionMetadata remains empty.

In the NCO 3 Programming Guide there is a short section "Working with Hard-Coded Metadata" which explains that a custom repository is required and that a destination can be assigned to a custom repository to allow any missing meta data to be looked up normally. Is this the only way to achieve persistent caching of meta data? If so where would one get some example code, as the document doesn't provide any?

Ultimately, what I am looking for is a solution to a co-located environment. The web application is designed to work with most versions of SAP, multiple destinations, and to be used on a daily basis. The requirement is to reduce the number of calls between the web server and the SAP servers in order to improve on stability of the application and reduce the bandwidth requirements.

Currently the application works fine, but sometimes gives errors such as "Function module "RFC_METADATA_GET" not found", or the incorrect metadata is returned and the application goes into error because of missing metadata. The only thing that we can pinpoint these random errors to is the massive amounts of metadata calls...

Any help would be appreciated

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi David,

a good explanation of what you like to achieve, but I would not call it an instability of NCo. Assuming that the function modules you are using are stable as you consider to harden them in the code, you can also consider the feature of persisting the repository - check out the Save() and Load() methods in RfcRepository for that. However, if function module definition would change, an inconsistency of the persisted definition and the one now used in the backend might break your scenarion. If such inconsistent and incompatible changes can be excluded in your case, your scenario should work fine and you would need much fewer metadata calls if some at all.

Best regards,

Markus

0 Kudos

Hi,

I am also searching for sample code of customized repository.

Regards,

Milan