CRMtimes.GIF (8509 bytes)

CRMtimesnav.GIF (22964 bytes)

 

commencerm_logo.gif (2110 bytes)

Forms Expert - Using Form Caching

Previous issues of CRMtimes have discussed many of the benefits of the new forms architecture in CommenceRM 3.0 including:

Commence have introduced "form caching" to manage the performance when opening a form containing all these new features. The process of caching builds a "fast load" copy of the form, which is then held in memory or copied to disk when you exit Commence (depending on the caching configuration discussed below). Of course if the form is modified, the "fast load" copy then needs to be updated.

Since the user is opening up and closing detail forms all day long, this process of caching makes a big difference to performance. Depending on your hard disk speed and and memory size/type, getting the form from the cache can easily be 10+ times faster than building the form from the definition file. 

Most of the time this goes on in the background and you don't even know it exists. However if you have been modifying any forms you might have come across something odd, if you make changes to a form and then save it, and re-open it, you won't see any of the changes you have made!!! This is because Commence is displaying the copy of the form from the cache, rather than the file you just modified. 

Configuring cache behaviour

The good news is that you can manually configure the behaviour of the cache. The form caching configuration information is stored in [OtherOptions] section of <databasepath>\data.ini file. 

As always, before modifying any settings we recommend making a backup of your database and the data.ini file first. 

There are three parameters which control the cache behaviour: FormCachePolicy, FormCacheSize and FormCache.

FormCachePolicy

0 - Do not cache any forms. Use this option when customising your forms and testing.

1 - Cache forms for the current session only. i.e. do not pre-load any forms or write the FormCache settings into the data.ini file.

2 - Auto cache forms across sessions. i.e. read the FormCacheSize and FormCache settings from the data.ini file and pre-load the forms. Also, write the FormCache settings when leaving the database. Use this setting for normal operations and best performance. [default]

Regardless of FormCachePolicy, changes to detail forms still sync to other clients and will be displayed correctly.

Regardless of FormCachePolicy, changes to detail forms still sync to other clients and will be displayed correctly.

FormCacheSize

  • This determines the max number of forms that can be cached, up to a maximum of 100
  • 5 is used as default if no FormCacheSize is set.
  • This entry is ignored if FormCachePolicy = 0 (ie set to not cache any forms).

FormCache

  • This setting is just a string of the form file names separated by semicolons ';'
  • This property is read and written if and only if FormCachePolicy = 2.
  • This value should not be be modified since it is automatically written by Commence.
  • If FormCache contains 10 file names and FormCacheSize = 5, then only first 5 forms will be pre-loaded.
Note that if entries for FormCachePolicy and FormCacheSize are not present in Data.ini file, the default values get used. 
The default values do not get written to the Data.ini file.

Examples

Sample DATA.INI settings - Everyday use:

In general you want Commence to be caching the forms, so your settings will be as follows (FormCache will be different for your database):

[OtherOptions]
FormCachePolicy=2
FormCacheSize=10
FormCache=FM001000.XML;FM001300.XML;FM000500.XML;

Sample DATA.INI settings - While customising and testing:

When you are customising forms, you want to disable caching, so use the following settings:

[OtherOptions]
FormCachePolicy=0
FormCacheSize=0
FormCache=FM001000.XML;FM001300.XML;FM000500.XML;

So by changing a few configuration settings, you can quickly go from normal mode to customising mode and back again, as you need. Don't forget to turn the caching on again, once you have finished customising your forms though.

 

Last Modified: 17:07, December 20, 2004.
bottomline.gif (4517 bytes)
CRMtimes - eNewsletter for Business Managers implementing CRM

auslogosmall.gif (726 bytes)

This site is sponsored by Advanced User Systems Pty Ltd.

Email: CRMtimes@aus.com.au
http://www.aus.com.au