How to release floating license without closing application?

950
2
08-08-2016 08:50 AM
CraigStephens1
New Contributor II

I have a .Net service that periodically needs to open a file geodatabase, do some processing, and then close the fgdb.  After the fgdb is closed, I want to release the license so that similar services running on other machines can grab the license for its process.

The standard documented steps that I have implemented:

RuntimeManager.Bind(ProductCode.EngineOrDesktop);

aoInit = new AoInitializeClass();

aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);

...

(process FGDB here)

...

aoInit.Shutdown();

After Shutdown() is called, the license manager shows the machine still has the license checked out.  The only way to get it to release the license is to stop the service.

Is there any way to release the license back to the license manager without having to close the app?

Reply
0 Kudos
2 Replies
ModyBuchbinder
Regular Contributor II

Hi

As far as I know this is the way it works and it is not a bug...

The way around is to write your ArcObject code in a different executable and run it from the main program (system call).

You can send parameters or create a file with information that the other executable will read when it starts.

Mody

Reply
0 Kudos
CraigStephens1
New Contributor II

Thanks Mody.  That's what I was afraid of... "the way it works".  It seems like this would be a relatively simple thing for Esri to address since it appears to be an open TCP connection that is keeping the product license checked out.

Moving the ArcObject code into a different executable is intriguing and probably worth pursuing.  Will make for an interesting team discussion.

Craig

Reply
0 Kudos