PDA

View Full Version : Checkout an additional license



wunshiun
01-16-2009, 04:41 AM
Hi, I have a question about using FLEXLM.

Suppose I have two licenses of myfeature.

If I had run the code such as
lc_checkout(lm_job, "myfeature", "1.0", 1, LM_CO_NOWAIT, &code, LM_DUP_NONE).

That means I had checkout one license of myfeature, right?

Now, if I want to checkout one more license of myfeature, can I use the same code to checkout an additional license of myfeature?

If yes, does any thing I should pay attention to?

If not, does any API I could use or no such API and I should checkin the license, which had been checked out, first and checkout two licenses of myfeature?

Thanks,

wunshiun

RobertDickau
01-16-2009, 09:43 AM
Normally, the requested license count in lc_checkout with a single job handle is an aggregrate number of licenses: lc_checkout with 1 license, followed by another lc_checkout with 1 license, results in only 1 license checked out.

Some options are:

After the first call, call lc_checkout with a count of 2, resulting in a total of 2 licenses (if available).


Create a second job handle (lm_job2, say), and then use that when calling lc_checkout with 1 again.


Use "checkout data", as described in the FuncRef-c.pdf section "Incremental License Count in a Single Job" (under the documentation for LM_A_CHECKOUT_DATA).

wunshiun
01-19-2009, 08:54 PM
Hi, RobertDickau,

I had done the first method as you described.
But there is a problem.

That is, if I first run the code lc_checkout(lm_job, "myfeature", "1.0", 1, LM_CO_NOWAIT, &code, LM_DUP_NONE), it will check out one license of myfeature.
And show a message as following,
OUT: "myfeature" wunshiun@myhost.

When I run the second code lc_checkout(lm_job, "myfeature", "1.0", 2, LM_CO_NOWAIT, &code, LM_DUP_NONE), it will show a message as following,
OUT: "myfeature" wunshiun@myhost (2 licenses)
OUT: "myfeature" wunshiun@myhost (2 licenses)
OUT: "myfeature" wunshiun@myhost (2 licenses)
UPGRADE: "myfeature" wunshiun@myhost (1->2 licenses).

And the checkin message as following,
IN: "myfeature" wunshiun@myhost (2 licenses)
IN: "myfeature" wunshiun@myhost (2 licenses)
IN: "myfeature" wunshiun@myhost (2 licenses)
IN: "myfeature" wunshiun@myhost (2 licenses).

It seems that I check out six more licenses.
Would you help me to explain this phenomenon?

Thanks,

wunshiun

RobertDickau
01-20-2009, 10:04 AM
That's strange; a similar test at this end has only these lines:

25:00:00 (demo) OUT: "CC" Robert@SYSNAME
25:00:05 (demo) UPGRADE: "CC" Robert@SYSNAME (1->2 licenses)
25:00:10 (demo) IN: "CC" Robert@SYSNAME (2 licenses)

If you run lmstat -a after the second checkout, does it show 2 or 8 licenses checked out?

wunshiun
01-20-2009, 11:34 PM
Hi, RobertDickau,

After I run lmstat -a, it shows 2 licenses checked out.

And I check the status returned by lc_checkout, the returned value is -8 not 0.

The checkout and checkin message are still the same.

RobertDickau
01-21-2009, 10:58 AM
As along as lmstat -a reports only 2 licenses checked out, you should be okay. (The debug log, which contains the OUT: and IN: messages, is meant for general debugging but isn't an authenticated log of the behavior.)

As for the -8 (LM_BADCODE) return value from lc_checkout, are there perhaps multiple license files being checked, where some are unsigned? You can use lmpath to clear out old license locations...

wunshiun
02-05-2009, 12:01 AM
Hi, RobertDickau,

I want to use lmpath to clear out old license locations. But it returns invalid command name "lmpath". It seems that there is no such command named lmpath. Please confirm.

Thanks,

wunshiun

RobertDickau
02-05-2009, 11:23 AM
It's part of lmutil, so if you have that, there's lmutil lmpath -status, and so on. You could also rename a copy of lmutil to lmpath (lmutil.exe to lmpath.exe on Windows), and then run lmpath commands directly.