Sunday 30 June 2019

Obj-Refresh and Lock method in pega

Obj-Refresh and Lock method in pega


Hi Everyone, in this post we will see how to use Obj-Refresh and Lock method in activity.

PDN Help Link:


This method we will use to acquire Lock on work object. Whenever we want we can acquire lock by using this method.

We opened the instance without lock . In later steps we need to get the lock on work object means we can use this method.

If we not sure whether we acquire lock or not then we can use this method to acquire lock.

If work object is already locked then this method will not affect.

Lets check Obj-Refresh and Lock by an example.

We have a data class Courses having some number of records. Will try to acquire lock on this instance by using Obj-Refresh and Lock Method. Before using this method we have to make sure that whether that class support locking or not.

How to check whether class support locking or not?

     If we open class definition we can see Locking tab there we can see Allow Locking check box.


Locking tab of Class rule:



So now we know that this class allow locking on instances.

Lets write an activity to acquire lock on one of these instances.

In below activity we used Obj-Open to open courses class record  without lock whose ID is "END-001" . So we not acquire lock yet.



In third step added Obj-Refresh and Lock method to acquire lock.


This Lock will be released on Commit . If we not added commit method then lock will not get released . We have to use this method with more care.

Added Commit step.


Lets test this by trace this activity :)

Make sure that you enabled locking in tracer settings to check this .


Activity got run successfully.

Lets check tracer,, In below image if you see on executing  Obj-Refresh-And-Lock method Acquire Lock  happened.

On Commit Release Lock happened.

While releasing the lock you can see a delete operation is performed from pegadata.pr_sys_locks table. Means while acquiring lock a record will be inserted in to this table which contains lock information like who locked and when it will be released.


Hope you understand about Obj-Refresh and Lock method.

Lets comment Commit method and execute this activity and look at the instance from System-Lock class.

From the below image you can see that lock is acquired but not release since we commented commit step.


So now this record will be there in System-Lock class.


Here you can see our record list here in System-Locks instance.

How to release lock ?

We can release lock on record by using a method Page-Unlock. We have to provide the step page which is locked.



Tracer:

 In the above image you can see Page-Unlock method released the lock.


Hope u guys understand this post. If have any doubt ask in comment section

15 comments:

  1. Woah ! Lots of Good Stuff Mate :)

    ReplyDelete
  2. A locksmith is a tradesman whose profession concerns the manufacture and defeating of locks. A lock could either be an electronic or a mechanical fastening device applied and used on doors, vehicles or containers to restrict its access. locksmith jonesboro ar

    ReplyDelete
  3. Information Technology (IT) debt is basically the cost of maintenance needed to bring all applications up to date. Shockingly, global "Information Technology (IT) debt" will reach $500 billion this year and could rise to $1 trillion by 2015! But why should you take IT debt seriously and begin to take steps to eliminate this issue from your business? 24 stunden schlüsseldienst

    ReplyDelete
  4. You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this... schlüsselnotdienst München

    ReplyDelete
  5. ording to baseball legend Yogi Berra, "If you don't know where you are going, you will probably end up somewhere else." Yogi's one liners often make me laugh, but they also make me think. His quip reminds me of the importance of having a plan when engaging in any endeavor that will impact our personal situations beyond the immediate here and now. That includes the process of estate planning. Now, I will grant you that Yogi probably wasn't thinking about estate planning when he offered this particular slice of wisdom. Nonetheless, his words are absolutely spot-on insofar as the importance of planning for that day which we will not live to see. As important as having an estate plan is for all of us, it is of even greater importance for the small business owner. I think it is no exaggeration to say that thoughtful estate planning is an essential component of every small business owner's overall business plan. Emergency Locksmith Bonita Springs

    ReplyDelete
  6. Old locks are common metal detector finds. They are also valuable and selling them can help the coin collectors build their collections. Learn some keys to these marvelous relics. kosten schlüsseldienst

    ReplyDelete
  7. Schwinn bicycle trailer models are available in six versions. Of the six models, the Schwinn Joyrider bicycle trailer is noticeably more stylish and outperforms other Schwinn bike trailers. The Joyrider is a very popular choice of child bike trailer and has many virtues that make it attractive to families. Not only is it a top of the line trailer for Schwinn, but it has a number of features that separate it from its competition. تعمیر درب پارکینگ

    ReplyDelete
  8. I really love the way you discuss this kind of topic.~;.`” Prabook profiles

    ReplyDelete
  9. Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you. ترید یا معامله چیست و تریدر کیست؟

    ReplyDelete
  10. Excellent explanation!. Thanks mate!

    ReplyDelete