The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

_lockseq fields in database (SD 4.5 sp24)

SOLVED
Go to solution
Highlighted
Gurevich
Member

_lockseq fields in database (SD 4.5 sp24)

Does somebody know something about <...>_lockseq fields in database? What`s this and how it works?
6 REPLIES
Sam decosta
Esteemed Contributor

Re: _lockseq fields in database (SD 4.5 sp24)

As per my knowledge LOCKSEQ field keeps tracks of no. of times item is Blocked and Unblocked. For example If you check in Rep_accounts table we have ACC_LOCKSEQ column.

Now you take any account and block it , you will see ACC_LOCKSEQ is increased by 1.

Points are welcome

Thanks,
Avinash
Ken Briscoe
Honored Contributor

Re: _lockseq fields in database (SD 4.5 sp24)

I thought it was more to do with concurrent update prevention. Lockseq increments with each update so OVSD compares current lockseq with that in DB for a record to see if anyone has updated it while you have it open. So I don't think it's just blocking and unblocking that increments it...any update will? But a long time since I looked at it, so could be wrong.
My email is kenilian@bigpond.com.au
Gurevich
Member

Re: _lockseq fields in database (SD 4.5 sp24)

It doesn`t look like block/unblock counter, and it doesn`t look like counter of opening times.

For example, SELECT * FROM sdrep.rep_email_commands

I have eco_lockseq = 15 in record, which wasn`t blocked (this type of objects can`t be blocked), and it isn`t open right now.

So i think it must be something else.
Ken Briscoe
Honored Contributor
Solution

Re: _lockseq fields in database (SD 4.5 sp24)

Hi Gurevich - it's not the number of currently open items, it's a progressive counter of the number of times it's been open.

I found this extract from an HP doc which I got a long time ago from the knowledge base..but I'm sorry I don't have the document ID. If you search HP KB you should find it. Here is what I extracted:
------------------------
The lockseq-fields are in the database for the optimistic locking mechanism of Service Desk.

Imagine person A opening a Service Call to work on it, and the lockseq-field of that Service Call is 20 (just for example). Now also person B opens the Service Call to work on it. Both will have the same Service Call open, with the lockseq set to 20.

If now, person B finishes working, they will save the Service Call, and the lockseq will be incremented with 1, so it will be 21. If then person A tries to save the Service Call, they will not succeed. Service Desk will try to save it and increment the lockseq (which is still 20 for this Service Call - the value it was when opening it) to 21, but because this now already is 21 in the database as a result of the saving of person B, an error-message will be returned stating person A cannot save the Service Call because somebody else already saved a newer version.

This is what the lockseq-field is used for in Service Desk.
----------------------------------
Hope that helps.....Ken.
My email is kenilian@bigpond.com.au
Ken Briscoe
Honored Contributor

Re: _lockseq fields in database (SD 4.5 sp24)

There is also a long forum item on locking:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xbcea660142b2d5118ff10090279cd0f9,00.html

This might give you further information.
But in any case, you should never need to touch these lockseq fields. Just ignore them!
My email is kenilian@bigpond.com.au
Gurevich
Member

Re: _lockseq fields in database (SD 4.5 sp24)

Ken, thank you very much! This is what i was looking for!

I`m not going to edit this field in DB in existing records. I just need to understand how it works.
//Add this to "OnDomLoad" event