Question
StateFarm
US
Last activity: 14 Sep 2024 10:17 EDT
how to force obj-open or obj-open-by-handle use db call instead of cache.
How to force obj-open or obj-open-by-handle use db call instead of cache. I am trying to open an operator and update the operator. But when i use the obj-open or obj-open-by-handle, it checks the cache instead of db. How do i force to hit the db or clear the cache so it doesn't hit the cache?
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 13 Sep 2024 9:08 EDT
Pegasystems Inc.
AU
Agree with that.
The cause of the reported behavior is the presence of record in deferred operations.
The next step would be to understand why the Deferred Ops has this record, some previous operations must be doing an Obj-save without write-now most likely and that step needs to be corrected.
There is a OOTB HTML rule @baseclass.defferredops which you can use to display the deferred operations after each step and identify where the record has been added to deferred operations.
Maantic Inc
IN
It should not because you open the record on its latest update, otherwise a data page can be used. Obj-Open and Obj-Open-By-Handle are ideally for saving data into the db so it should not check the cache.
Maantic Inc
IN
I've never seen it before. If that's the case there's a defect in Pega's codebase. Please raise an SR.
Pegasystems Inc.
CA
Obj-Open and Ob-Open-By-Handle trigger a SQL query to open the record direclty from the database table. If you run the tracer, you can see the SQL query based on your pzInskey for Handle and query parameter for Obj-Open.
StateFarm
US
But for my scenario it is looking at cache. Should i open an SR?
I am trying to open my own operator using obj-open and also tried obj-open-by-handle. And it took the cache. Look at the attached tracer screenshot.
Pegasystems Inc.
CA
@VenkatRaman Yes, I think so..
Pegasystems Inc.
AU
Please use Obj-Browse as it fetches from the DB directly.
Obj-Open or Obj-Open-by-Handle opens the one from deferred operations if any exists there.
StateFarm
US
@KarthikEppili Thanks for the response. Performing simple updates using obj-browse is acceptable. However, when dealing with complex updates, it is recommended to use locking to prevent data discrepancies. Additionally, for tasks such as retrieving the workbasket list and teams and updating them dynamically, using obj-open is preferable as it requires less maintenance compared to obj-browse.
Pegasystems Inc.
US
Hi @VenkatRaman
Please let us know the ID for your Support Case so that we can link this discussion to it to assist the Support Engineer reviewing it.
Accepted Solution
Updated: 13 Sep 2024 9:08 EDT
Pegasystems Inc.
AU
Agree with that.
The cause of the reported behavior is the presence of record in deferred operations.
The next step would be to understand why the Deferred Ops has this record, some previous operations must be doing an Obj-save without write-now most likely and that step needs to be corrected.
There is a OOTB HTML rule @baseclass.defferredops which you can use to display the deferred operations after each step and identify where the record has been added to deferred operations.
Jabil
US
Hi all. Thanks @KarthikEppili for the great illustration of that Pega Engine API!
Small typo - @baseclass.DeferredOps