on 04-28-2018 10:02 AM
I might not be using Begin.Context/EndContext right as I have concurrent threads using a mix of destinations (including multiple threads using the same destination), each doing without synchronization concurrent operation on what i thought would be their private Stateful connection.
The first symptom of trouble is that after a few -successful- calls, User property in RfcConfigParameters gets zero'ed. If a thread does another call on the RfcDestination instance it got, there will be a Repeat Logon failure exception because the user name ain't right anymore.
I don't know why the user name gets stamped with zeroes, I wonder if a SecureString or alike implementation is taking hold of the provided credentials, get the byte array backing the string and stamps over it with zeroes once done in fear of leaking the sensitive information. What doesn't add up however is that the password is still there, only the user property is zeroed.
I've attempted to workaround the issue by checking the RfcDestination Parameters property each time before using the RfcDestination, and if they do not match with the values I provided (and still have a copy of), I signal a configuration change with the destination configuration singleton i registered with change event support. In the Rfc configuration event arguments, I provide type changed and include USER and NAME in the changedParameters. For the thread that triggers it, i get a new RfcDestination from NCo and in there I do see the User property of the Parameters is back to the actual user name, not zeroes. However for other threads that are in the middle of calling something on their reference of RfcDestination after checking it, they get an NCo exception of Rfc Destination is shutdown - cannot for instance get SystemAttributes -.
In the NCo 3 programing guide there is mention of a sample for using NCo in multi-threaded environment. Where may I find / download this sample? Is there an article on best practices / guidelines for multi-threading and NCo?
A couple updates on this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.