cancel
Showing results for 
Search instead for 
Did you mean: 

Any body encountered " cannot unregister the given destination configuration " error for SAP.Net 3.0 connector

Former Member
0 Kudos
1,327

I have a requirement where I need to call call SAP frequently and get the data.

For this I am registering, getting the data  and unregistering the destination. But some times I am receiving error message which says "cannot unregister the given destination configuration"

Does any body knows how to resolve this.

View Entire Topic
Former Member
0 Kudos

Hi Markus,

Thanks for the reply. I never mentioned that the NSAPConnector approach is the correct approach.

As a developer I do not have control over the infrastructure. So its needed to mold code to fit the existing infrastructure. I am migrating the code from SAP Connector 2.0 to 3.0. So do not have many option available with me. Your reply make sense though.

Do you have some documentation where it has been mentioned or a place where you have discussed it. I might have missed those, would be great if you can share the links.

Regards,

Anand

hynek_petrak
Active Participant
0 Kudos

HI Anand,

did you try to register your destination configuration in the Application_Start method in Global.asax? This suppose to be executed once per the lifetime of an application in the asp.net. This's been working for me so far.

hynek


public class Global : HttpApplication {

        void Application_Start(object sender, EventArgs e) {

            // Code that runs on application startup

            RouteConfig.RegisterRoutes(RouteTable.Routes);

            IDestinationConfiguration dc = new SqlDestinationConfiguration();

            RfcDestinationManager.RegisterDestinationConfiguration(dc);

        }

        void Application_End(object sender, EventArgs e) {

            //  Code that runs on application shutdown

        }

        void Application_Error(object sender, EventArgs e) {

            // Code that runs when an unhandled error occurs

        }

    }

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Anand,

so far it is mentioned not in that detail in the documentation, but pretty short. I can recommend to have a look at the API documentation of NCo and the programming guide. In addition it makes sense not only to look at NCo, but also at JCo API documentation. Both JCo 3.0 and NCo 3.0 share the same concepts in that regard. This is also a general remak - many concepts are the same. So, in case you don't find an answer for one of your questions about NCo, check whether there is an answer for JCo.

Best regards,

Markus

Former Member
0 Kudos

On ASP.NET MVC (as I know)  is a bad practice to use the Application_Start because can be executed more than one time , maybe can be more effective is you used something like Singleton pattern (static variable flag to ensure the first tie execution of the method)

former_member197445
Contributor
0 Kudos

I respectfully disagree.  Nothing wrong with using Application_Start.  This event only fires when the IIS app pool comes on-line.

Former Member
0 Kudos

Thanks Ahr,  I overreacted my answer haha I was thinking in the context that there are more than one application instance in the same project (IIS works like you said but can be more than one instance after that) but  re-thinking  about that, the Application start method, in theory, will be run only one time.

There is still the small  possibility  only when there is more instance of the application class at the same time.

Is a best practice use Application start but is another best practice never assume that the thinks will work perfectly without testing it and know some of the behavior.

Regards,
Eduardo