Skip to Content
avatar image
Former Member

Can we serialize/deserialize connection object

Hello All,

We have a requirement to keep the connection open while the user is working with a given record in order to maintain a lock on the record until the user moves out of the current record (so that other users cannot work on the same record). If we close the connection object after each BAPI call the record will be unlocked since the SAP backend session will be the closed. So we have to use the same connection across multiple BAPI invocations for the same record within the same session. We are using ASP.NET 2.0 and SAP .NET Connector 2.0.1. We are currently researching a way to store the connection object in ASP.NET out of proc SQL server based session and have been unsuccessful in serializing/deserializing the proxy object. We tried storing the connection object in the session as well but looks like internally some of the properties within the connection object are set as non-serializable. Our .NET web servers are in a load balanced environment so we have to ensure the connection remains open even when different requests are serviced by different web servers. We cannot use connection pooling as well since internally the pool is an arraylist within a given web server and my understanding is each web server will maintain its own pool. Also we use the MYSAPSSO2 ticket for invoking RFC based BAPI calls. Please let me know if anyone has come across this requirement within your projects and have any ideas, suggestions or alternatives.

Thanks for your help

Narayanan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    May 27, 2008 at 04:25 AM

    Have you tried to save the SSO ticket?

    Then you can build the connection again, and open it using the SSO ticket you've saved before.

    Here's the sample code:

    ERPConnect.R3Connection conts = new ERPConnect.R3Connection();

    conts.Host = "duncan";

    conts.SystemNumber = 7;

    conts.Client = "800";

    conts.Language = "DE";

    conts.OpenSSO(Session["ssoticket"].ToString());

    FYI, I use ERPConnect.

    I hope it helps.

    Add comment
    10|10000 characters needed characters exceeded