cancel
Showing results for 
Search instead for 
Did you mean: 

Destination is Locked

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Active Contributor
0 Kudos

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!