I don't use transactions in my program. I use algorithm shown below:
public boolean setValue(int a_new_value)
{
this.exclusiveLock();
if(this.value != a_new_value)
{
this.value = a_new_value;
this.modify();
}
...........
if(this.isModified())
this.store();
this.unlock();
}
This code invokes in different concurrent threads. Perst storage works with INFINITE_PAGE_POOL, and naturally it use StrongHashTable. So, when I invoke IPersistent.store(), code in StrongHashTable works:
public synchronized void setDirty(Object obj) {
if (nModified < MODIFIED_BUFFER_SIZE) {
modified[nModified] = obj;
}
nModified += 1;
}
The variable "nModified" will reset never in my code because I don't use Storage.commit(), and "modified[]" will full always.
After my program has worked 6 months the variable "nModified" overflowed.
How I must change my code to prevent this problem?
PS I don't use Storage.commit() because I think that .store() more quick. Or I mistake?


This topic is locked









