Enabling Batch Caching
This section shows the concept of how batch caching is independent of external caching. Therefore, to avoid write-through caching, you can enable either of the caching mechanism using the following procedure.
- Open the tafj.properties file.
- Enable the following batch property.
temn.cache.runtime.use.batch.write=true
- Disable the following external caching property.
temn.tafj.runtime.use.external.caching=false
- Open SQL and create a batch enabled file by using the following command.
CREATE-FILE BATCH.WRITE TYPE=XML BATCH_WRITE=8
This step creates an XML file and a record in the
TAFJ_CACHE
table.
How batch caching works?
The step-4 of the above task creates a record in the TAFJ_CACHE
table. For example, let us assume that the newly created record has the following properties:
- RECID - BATCH.WRITE
- CACHENAME - WRITECACHE
- WRITEBATCHROWS - 8
Here, WRITEBATCHROWS specifies how frequently you can push or flush cached records into the database. It is important that you identify how much memory the batched tables will occupy and how many threads you want to run. Without adequate memory, you may encounter memory violations.
Therefore, in the above example, JBC WRITE statements upto the 8th row of the BATCH.WRITE table. On the 9th row, the record is pushed to the database and the internal cache is cleared. You should not commit the pushed records until the cache status reaches TRANSEND or TRANSABORT.
TAFJ_CACHE
table. This is possible only if the records have their RECID that matches the TAFJ_VOC
RECID, a cache with a name WRITECACHE, and some valid integer for BATCH_WRITE.In this topic