Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LAPI session 1

Status
Not open for further replies.

ahaboub

Technical User
Jul 31, 2009
41
LB
Hi,

I have created a small application with LAPI using vb.net.
Now i am trying to enhance the code i have written. One of my issues is to disable multi sessions running from the same application. As for now, i can run two (or more) instances of my application at the same time, and that is what i need to prevent.
Any suggestions on how to manage such an issue?

thanks and regards,
Abdul
 
I can do this within .net coding
but i would like to try it based on LAPI session.
 
Not sure I understand what you are running into.But LAPI is just a series of commands that your program issues against a livelink server.On a usual livelink server there are perhaps 5 threads so if you look at my example here.
Lapi program trying to add a document using the following major steps.

Login session constructor which is what you think is the session.
Accessenterprise workspace,thread 1 gave you that
ListObjects thread 3 gave you that
CreateObject thread 4 did that
CreateVersion thread 2 did that.

The session object in your lapi programs memory gives each thread what it asks for like login session,dapi session,wapi session and uapi session and so on so that you do not have to initiate that agaan and again

So as you can see lapi is not executing your commands on a single blocking thread,so if you need some stuff to be pesistent then you need to write it to a file or database table.

Going by my above eg if the same lapi application is executed twice you should check some where like a semaphore to prevent the same application again.

In oscript there is a singleton call that you can design so that you can instruct livelink to execute only one instance of it,that too works only on the 5 threads that server .Things like the ObjectImporter checks if any other instance is running and gracefully exits.That is how thread safety is accomplished in oscript.

Since LAPI is just a bunch of oscript,you can write your own api and make it blocking as well.


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top