It's all about the answers!

Ask a question

Is BuildForge::Services::Connection same as login from GUI?


Jirong Hu (1.5k9295258) | asked Dec 19 '12, 9:48 p.m.
Hi 

I use the following Perl API in my ClearCase trigger to launch a BF project. Now I am worrying about the concurrence, because many users may run this code at the same time.

From BF Management Console GUI login, if I login with the same user, the other console logged in with the same user will be automatically logged out.

What will happen to the code below? Can BF accept multiple connections concurrently with the same login id?

   my $conn = new BuildForge::Services::Connection('ccbuildforged01', 3966);
   $conn->authUser('bldforge', 'password');

Thanks
Jirong

2 answers



permanent link
Spencer Murata (2.3k115971) | answered Dec 21 '12, 9:24 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Strictly speaking the answer is no.  We do not allow concurrent connections, but you can share a single connection among different clients if they have access to the auth token.  There is a token returned by the authUser method call, which can then be used by the authToken method to share the one session.  So if you protect your API calls that require authentication with semaphores you can share the session via the tokens.

So with your code currently if you execute it concurrently it will constantly log out the other scripts with whichever one was the last one to execute.  So the other scripts will fail since their session will be invalidated by the last script to run.

~Spencer

Comments
Jirong Hu commented Dec 21 '12, 10:17 a.m. | edited Dec 21 '12, 10:20 a.m.
Hi Spencer

  1. How to store this token? The call to BF is launched by ClearCase triggers, so different calls are not in the same process.
    1. How long is a valid session?

    I think I have to go another way to resolve this issue. We have 10 BF licenses so can have 10 concurrent login with different ids. So I can create a persistent stack (use a file?) to store these available ids. What do you think?

    Thanks
    Jirong

     

permanent link
David Brauneis (50611) | answered Dec 26 '12, 10:02 p.m.
JAZZ DEVELOPER
 Depending on the version of Build Forge that you are using, you might want to take a look at API user (this was introduced in Build Forge 7.1.3) as it was designed to allow for this type of scenario but it will not be allowed to login and access the GUI.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.