Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
...
The curValue and nextValue functions are used to get the current and next values in the cached sequence.
Use the block size to specify the range of values in the sequence. For example, set a block size of 100 to cache 100 consecutive values. PhixFlow checks the database to determine the next available number in the sequence and then sets the next sequence of numbers as "used" in the database. The numbers are stored in the cache. When PhixFlow needs the next number in the sequence, it uses a number from the cache.
When all the values have been used, PhixFlow generates the next set of values in the sequence and saves it to the cache.
Note |
---|
It is much quicker for PhixFlow to retrieve a value from the cached sequence than it is to go back to the database to calculate the next number in a sequence. |
If something clears the cache, such as Tomcat being restarted, any remaining numbers in the cache are lost. This can lead to item values having gaps in the sequence.
...
...
...
...
For quicker performance, set the block size to a large value greater such as 100, or 10000.
To configure the sequence to generate values without any gaps in the sequence, set the block size to 1. This causes slow performance as PhixFlow has to perform database calculations for before providing the next value in the sequence.
Tip |
---|
If you require a continuous sequence of values for items, and the data set being processed is small, you may decide to accept the added overhead of calculating every value in the sequence. If the data set is large, it is better to use a large block size, to optimise performance. If you require a continuous sequence consider an alternative method of assigning the value. |
...
...
...
...
...
...
...