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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue Faced while implementing threading for content extraction

Status
Not open for further replies.

ujjval090683

Programmer
Nov 1, 2011
31
IN
I am facing a problem while trying to implement multi-threading to extract content using the LinktoShare extraction tool. The exception occurs when multiple threads try to call an inbuilt LAPI method FetchVersion.I have written a c# code which populates a list with object ID’s and threading is implemented inside a loop which is executed for a count equal to the no of ID’s in the list.
Each thread executes the above mentioned method.It runs the thread till a specific count which is not fixed and then throws exception.

One of the exceptions thrown is:

get(name) not implemented for this datatype

Exception Details: com.opentext.api.LLIllegalOperationException: get(name) not implemented for this datatype

[LLIllegalOperationException: get(name) not implemented for this datatype]
com.opentext.api.LLInstance.get(String name) +46
com.opentext.api.LLValue.toValue(String name) +12
com.opentext.api.LLConnect.unMarshall(String argName) +40
 
get(name) errors are because of old lapi error reporting. LAPI when it is successful returns 0 or a positive number as the error code.

If it is not zero then your code should not try to enumerate any of the LLVALUE variables as LLVALUE variables can be used for both IN and OUT operations.So if your code is trying to enumerate a value which was not returned to you it will be problemtic.

in psuedo code

Get a Session
Initialize data structures as VALUE objects for getting stuff and setting stuff.Do not use setAssocNotSet...

Call a LAPI method

Is error code > zero then call failed do not enumerate
any LLVALUE stuff
else
enumerate stuff

This is why when you look at lapi code you will see the use of LL_OK all the way for even simplest calls.every lapi call is not answered by the same livelink thread so you cannot depend on that 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,Livelink ECM Champion 2010
 
also if you want to close to thread safety you might want to create a new session for each thread that you invoke.

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,Livelink ECM Champion 2010
 
thanks for the reply. So, we we do not use setAssocNotSet then what cna I use? Also when I run single thread, or 2 to 3 thread it runs fine, but when I run more thread then it is giving error.

Is there any setting needs to be done at livelink server side?

I have created different sessions for different threads.Still facing problem.
 
i'm trying to run 10 threads the other exceptions thrown are.....

Server did not accept open request
Could not read router packet from socket
 
Ok I did not understand that from that screen cap.So the code has to be smart to offer a webnodecmd object dynamically on the fly in the admin factories page .....

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,Livelink ECM Champion 2010
 
sorry replied to the wrong post but fro lapi here is what usually poeple will do.

Reserve one or two front end livelink servers for lapi calls.This means that you will get a maximum of 10 livelink threads which should handle a lot of calls.Each thread in livelink is separate in its own memory space and this has no realtion to the client threads in your C# program that you are talking about.

When you create a session it is akin to your code saying telnet <livelink server> <lapiport> so if there are no more resources at the other end you can imagine what you are going to get.This is the reason why you want dedicated instances for lapi because lapi is just like any other user hitting the livelink server.If a livelink server is doing user requets,lapi requests and other requests so it has barely time to recopu itself then you will run into thread startvation issues.

So when I want a multithreaded program people code like this


Create a LAPI POOL
SessionServer1=lapi session to exclusiveserver1
SessionServer2=lapi session to exclusiveserver1
SessionServer3=lapi session to exclusiveserver1
SessionServer4=lapi session to exclusiveserver2
SessionServer5=lapi session to exclusiveserver2
SessionServer6=lapi session to exclusiveserver2

My C# code execution
Pickup a session and hit that server
For each lapi call however small check session error
If session is lost then re-initialize that session
Do not enumerate unless lapi return is zero.


As Greg said LAPI is being deprecated by calls made specifically to livelink web services ,but behind the covers the EWS calls livelink on the lapi port so you will run into thread starvation there as well if not properly designed.But EWS returns you a authentication objects with every ews call so you are pretty much covered that you won't lose your session.





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,Livelink ECM Champion 2010
 
Thanks you very much for such a wonderul explanation.I have few doubts in this.

First,I am using LAPI and nto the webservice, reason, I am not aware of webserrvices, know only LAPI. (Let me know if webservices are really eassy to impliment compare to LAPI then will learn that).

So, you are saying creating multiple session, right? I have create multiple sessions, and eash thread of my client code have one session.

Is this what you are trying to say?
 
EWS is very easy,if you have a livelink server on 9.7.1 or above.you have to figure out a webserver to host the EWS it can be a virtual directory on the same livelink server as well.Once you can address the EWS like hit the WSDL then in code you can set it to talk to any livelink in your org or you can in your web.config dedicate that ws to talk to just one livelink server.

WS are clinet stubs just like you import lapi client libraries into your C# program.Instaed of locally copying files into your program as in lapi EWS just uses a central server on which EWS is loaded that is all.

EWS is new so a lot of functionality that LAPI users got during the 10 years or so it was developed,it will take a few years for it to mature.

If you are a smart learner I would advise yo to run a IIS livelink webserver in your computer,download the free C# express form MSDN,dowload a snippet of EWS code form the KB and run it and debug it learn and I think you will become productive in less than 4 hrs :).

you do not have to worry about datastructures as in lapi as websvcs are strongly typed more in tune with modern dev.

In case you are wondering why I know a lot of things,both Greg and me are livelink junkies and you will see me in his website take a peek.




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,Livelink ECM Champion 2010
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top