It's all about the answers!

Ask a question

problem with the lscm load command

Martin Wassermann (13864044) | asked Jan 17 '13, 7:16 a.m.
retagged Jan 17 '13, 9:03 a.m. by Dr. Hans-Joachim Pross (1.1k4458)


I want to write a lscm batt script that load a workspace. Therefor I have written following script

call lscm login -r https://jazzserver/ccm -u wassermann -n jazzserver
call lscm load -r jazzserver  "Wassermann Workspace"
call lscm logout -r jazzserver

When I run this script, the first line works fine, the scm tool ask me for my password. But the second line ask me for my password again. If I enter my password again the connection is refuse because it already exists.

Did anybody see what is wrong with the script? Why didn't the load command use the connection I had created with the login command? Or ist this still a bug in version 4.0 (we migrate to 4.0.1 on Monday)

Thanks, and regards,

Accepted answer

permanent link
Tim Mok (6.6k38) | answered Jan 17 '13, 9:54 a.m.
If you use the "-c" option, it will prompt for your password and cache it.

Help for: lscm login
Purpose: Stores the credentials to use when logging onto a repository.
Usage: lscm login [options] 

  --certificate arg          - The file that contains the user's login
  --smartCard                - Uses the connected smart card for
  -c [--cache]               - Caches the password on prompt. 
  -n [--nickname] arg        - The nickname of the repository.
  -P [--password] arg        - The password for the repository. 
  -r [--repository-uri] arg  - The URI that specifies the location of the
  -u [--username] arg        - The username for the repository.
Martin Wassermann selected this answer as the correct answer

Martin Wassermann commented Jan 17 '13, 9:59 a.m.

Thanks, that helps a lot. But does the lscm tool need a new login for every singel command or is it possible really to reuse one existing login?

What about the performance if lscm need to login for every command?

Tim Mok commented Jan 17 '13, 10:52 a.m.

I'm not sure what you mean by needing a new login. The password is cached so you don't have to enter it again. You're also using the "-n" option to cache the repository. When you specify the nick for the repository, it will use the username and cached password when you ran the login command.

The lscm invocation launches a daemon so that subsequent calls will be faster. Using scm doesn't launch a daemon so the overhead of running commands with it will be higher. Depending on your use, you may want to use scm if you don't want any daemon running (and tracking a sandbox) after your command is executed.

2 other answers

permanent link
Dr. Hans-Joachim Pross (1.1k4458) | answered Jan 17 '13, 8:57 a.m.
edited Jan 17 '13, 9:05 a.m.
When I just run the scm command and not the lscm-batch without the login before
scm load -r https://jazzserver/ccm -u <user> <workspace name>
it works fine for me. I'm asked for the password and the load occurs.

Martin Wassermann commented Jan 17 '13, 9:05 a.m. | edited Jan 17 '13, 9:54 a.m.

Yes, then it works. But I want to user more load commands in my script and I want to avoid entering my password every time. Also for performance issues I want to use the lscm.bat, not the scm.exe

permanent link
Martin Wassermann (13864044) | answered Jan 17 '13, 9:03 a.m.

OK, i have found one of my problems. The scm tool is case sensitive (even if in the server settings the "case sensitive" option is disabled). So in the jazz database my user name is WASSERMANN. So for the first login he accepts my user name in lower case. But when the scm tool wants my password again for the load command, it differs between wassermann and WASSERMANN. Because jazz doesn't allow two different connections to the same jazz server, he refuse the second one.

But I want still to avoid that I must enter the password for every command. Is there a way the lscm tool only user the connection I have created with the login command?

Shashikant Padur commented Jan 18 '13, 1:42 a.m.

Yes, as Tim mentioned you can use the following to cache the password...
lscm login -r repoUri -u username -n uriNickName -c (will prompt for password and cache the password)
lscm login -r repoUri -u username -P password -n uriNickName

Once the password is cached for the user, you can run commands without having to enter the password. To remove the cached entry, you need to run the logout command.

Your answer

Register or to post your answer.