Skip to Content
author's profile photo Former Member
Former Member

Destination is Locked

Can anyone tell me what this error message means:

"Cannot change property as Destination is Locked. This happend when the desitnation is assigned to a connection."

The connection was working fine until I received this message. Could this be caused by to many open connections?

Can I programatically unlock the destination.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 11, 2005 at 03:11 PM

    A destination is locked, when it is associated with an open connection. In this case it is not allowed to change properties of the destination, because they could anyway not incluence the open connection. Here is a sample:

    Destination dest = new Destination();

    dest.AppServerHost = "host";

    // ...

    Connection conn = Connection.GetConnection(dest);

    // now conn and dest are associated.

    dest.AppServerHost = "host1"; // still possible, because conn is not yet open.

    conn.Open();

    dest.AppServerHost = "host3"; // throws exception, because it is too late to change the settings.

    conn.Close();

    dest.AppServerHost = "host4"; // works again.

    If you don't like this behavior, you can create the connection from the connection string instead of having this "coupling" of Destination and Connection:

    Destination dest = new Destination();

    dest.AppServerHost = "host";

    // ...

    Connection conn = Connection.GetConnection(dest.ConnectionString);

    // Any further change on dest don't have any effect on conn!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.