| Home | Previous Lesson: Course 3:: Session 24 :: Page 200 Next Lesson: Course 3:: Session 24 :: Page 220 |
| DataWindow
Caching Service In some situations, you may need to minimize the database access and want to store the retrieved data in the memory for further access in the application. In such cases, you can use the PFCs DataWindow chatting services. PFC uses DataStores internally to cache the DataWindows data. As usual, you need to turn on the DataWindow caching service: gnv_app.of_SetDWCache( TRUE ) Then you need to register the DataWindow that need be cached by calling of_Register() function. This an overloaded function. Call with appropriate arguments depending on the caching type as explained below:
Call of_IsRegistered() function to check whether the DataWindow is cached or not. To use the cached data, you need to first call of_GetRegistered() function and then share the data. For example: gnv_app.inv_dwcache.of_GetRegistered(
& The above example is using an instance variable "ids_datastore" to point to the cached data and the actual DataWindow is sharing the data from the DataStore. If you are using the first method to cache the data, i.e., the cache service is used to retrieve & cache the data, then you can ask the cache service to retrieve the data by calling of_Refresh() function. Even though you dont have to turn off the DataWindow cache service explicitly, we advise you to turn off the service as soon you are done with the service. |
| Home | Previous Lesson: Course 3:: Session 24 :: Page 200 Next Lesson: Course 3:: Session 24 :: Page 220 |