You are viewing limited content. For full access, please sign in.

Question

Question

Problems determining Entry Lock information using SDK

asked on August 11, 2016

I used the code in the following post to identify the person who has a lock on the document...

http://answers.laserfiche.com/questions/98818/Determining-in-the-SDK-the-user-name-holding-a-lock

When I call EntryLockListing.GetListing(0, lockListSettings, entryInfo.Session) (entryInfo is a reference to my documentInfo class) I  get the following exception..."The object must have its connection set before it can be used".

Can anyone help me resolve this please?

Also, I find it curious that even though the document is locked the IsLocked and IsPersistentLock properties are both false and the EntryLock is null.  I am checking these properties but since they are null get an LockedObjectException whenever I try to modify the document.  I would expect on of the "IsLocked" properties to be true and the EntryLock to not null.  I have the document locked because i am modifying the metadata in Web Access.  Why are these not set correct?

 

0 0

Answer

SELECTED ANSWER
replied on August 11, 2016

That error means entryInfo.Session is not a signed in session. is that entryInfo object a valid entry object?

The locked/peristentlock properties on an entry object represent whether that object has the lock. That is why the entry lock listing exists, to see who holds locks without being the lock holder.

1 0

Replies

replied on August 11, 2016

I figured out my first problem.  I was catching the exception outside my using (Session...) code so the session was closed....doh!

Would still be interested in knowing why the "lock" properties are not set as expected on the entry.  

 

0 0
replied on August 11, 2016

Did you call Lock() on the same entry that you are checking the IsLocked property on?

0 0
replied on August 11, 2016

Your first response answered my question...I posted the question at the same time you responded.  It is being the "lock" properties are specify whether the current session locked the document.  I guess there are cases where this information might be useful but it seems in most cases you would know that you locked the document without having to check the properties since you are the one writing the code.  Although I suppose it is useful if you are calling black box code and want to know if it locked the document.  Thanks for your response.  This has been extremely educational.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.