Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
pgrazaitis

New Member
Registered:
Posts: 2
Reply with quote  #1 
I am curious to know if anybody has a deeper understanding of how the CacheHelper mechanism actually works?  It seems to consume the object itself when hydrating/dehydrating the DataSet object via the GetCachedMboState.  However the "this" object would presumably be garbage collected across forms, actions, stages.  Reducing the value of caching, and potentially causing a ton of stale caches.  I don't know if you could or should implement a Singleton pattern in the hopes it will be theoretically persistent across code.

What I am trying to do is to load into memory a Lookup table that is available in memory to calls throughout the map, and reducing the calls to the database.  It almost appears as though the CacheHelper, because of the garbage collector is only as good as a few calls that are in a limited scope.  Does that only mean I can reduce calls to the database during the ubiquitous form refreshes, and was that the original design?  Or is their some other method that the CacheHelper is using to retrieve the appropriate DataSet across the entirety of the map when referenced?

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
Quote:
Originally Posted by pgrazaitis
Does that only mean I can reduce calls to the database during the ubiquitous form refreshes, and was that the original design?


Nailed it in one. That is exactly what it was for, and what it does.

In my experience, unless the query in question is slow, just accept the almost immeasurable performance hit. Look at the SQL executed during an action start, and no one query will make that slower unless it is particularly slow.

If the query is slow, make it faster with an index etc.

We maintain several systems, in Oracle, SQL Server, and some a mixture. Making the database faster through good SQL, database configuration and indexes is easiest, and makes the system fly. We have one query form that does an extraordinarily complex query against 50 to 100 million records, and it returns values from a dynamic selection in less than a second.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #3 
You could (in theory, coz I'm still exploring this myself) use static class property in some script class to act as a true cache.

Static properties seem to have 2 features

a) The static properties are global (across different folders)

 

b) Static properties get reset when engine is reset

So that being the case, you could have a global repository of cached objects that get reset on engine reset. If you want to reuse those objects in grids/forms you may end up having to wrap them with a Scripted business object. 

0
pgrazaitis

New Member
Registered:
Posts: 2
Reply with quote  #4 

I thought about that as well, I just wasn't sure about B).  I even thought about an externalized service for caching which would allow things other than just DataSets to be cached.

0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #5 
Technically, something like a static dictionary class that takes a key of "folderID + variable name", and returns an object could be developed...that can work with anything, not just DataSets.

An external service would probably be easier to work with in the long run though. The only trick I see with that is its decoupled from the engine now, if you want to reset it or something - unless you figure out a way to host it as a DLL or Webservice on the engine itself :)
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #6 
Looks like the static properties get reset even without a server restart...possibly some internal mechanism that metastorm uses to refresh every "x" hours. Or maybe more intelligently "x" hours after its last use.... who knows?

Eitherway though, it acts as a quasi cache, as long as you're ok with having some performance gains at the cost of no control over when things are cached/refreshed.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!