Lets take an example of Demo site where maximum value of Batch_start is 100 Initially. After the first access its value will be stored 200(Origanl Batch Start+Batch Size).As code below:-
Code: Select all
Long originalBatchStart = idGeneration.getBatchStart();
idGeneration.setBatchStart(originalBatchStart + idGeneration.getBatchSize());
when first application is deployed then customer gets the id like 100,101...... Suppose 150 key are used. After that Our application undergoes a undeploy. We Deploy the application again. Now Our id sequence starts from 200 as Now in batch_start value is 200.(Yes we will not store the value demo_start 100 as in case of Demo site at the time of deployment).
Result :- 5O key are unused (151-200)
Although batch size value is very much large bigInt[20]=18,446,744,073,709,551,615. But this value will reached early so we have to think about it. If i am not wrong we have to start the batch_start value from next value to the value at the time of undeployment.
Please reply with your thoughts.Perhaps I am not on right track
Thanks