Forum Discussion
Concurrent transactions in different sessions by single user
Hello,
We are happily using sessions to isolate active folder setting in concurrent requests issued by the same user. However, if we introduce transactions in the concurrent requests, submit_transaction fails for both requests with
Exception caught in System::urn:iControl:System/Session::submit_transaction() Exception: Common::OperationFailed primary_error_code : 16908289 (0x01020001) secondary_error_code : 0 error_string : No transaction is open to submit.
Is this a supported scenario - two simultaneous transactions in two different sessions for the same user? If not, are there alternatives to implement this behavior? We are using iControl-11.3.0 for Java.
Ivaylo
I believe the transaction is stored as a session variable for the given user's context on the server. If you have two parallel sessions with the same user using transactions, the first call to submit_transaction() will proceed and delete the transaction id. If you call it a second time from the other session, it will likely fail as the transaction id has been removed by the first call. The only real solutions is to use the locking mechanism in the System.SystemInfo interface. The first session can acquire a lock and then perform it's transaction. The second session will attempt to acquire a lock and wait until one is available and then lock it's attempt at a transaction. I wrote about those interfaces in the article on Concurrent iControl Programming - https://devcentral.f5.com/articles/concurrent-icontrol-programming-explained.
The other option is to use multiple user accounts.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com