You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just ran into a strange problem where the cache is not validated properly and I get an outdated value returned. I must have misconfigured something because the cache entries "txnId" is not set, so the validation with the contents of the memory is skipped.
In the code below you can see that if "txnId" is not set, the validation is skipped. Does anyone have an idea how to prevent the txnId from being lost?
get(id,options){letvalue;if(this.cache.validated){letentry=this.cache.get(id);if(entry){letcachedValue=entry.value;if(entry.txnId!=null){// <====== entry.txnId is undefinedvalue=super.get(id,{ifNotTxnId: entry.txnId,transaction: options&&options.transaction,});if(value===UNMODIFIED)returncachedValue;}// with no txn id we do not validate; this is the state of a cached value after a write before it transactselsereturncachedValue;// <====== because entry.txnId is undefined i get a outdated value from the cache }elsevalue=super.get(id,options);}elseif(options&&options.transaction){returnsuper.get(id,options);}else{value=this.cache.getValue(id);if(value!==undefined){returnvalue;}value=super.get(id);}if(value&&typeofvalue==='object'&&!options&&typeofid!=='object'){letentry=this.cache.setValue(id,value,this.lastSize>>10);if(this.useVersions){entry.version=getLastVersion();}if(this.cache.validated)entry.txnId=getLastTxnId();}returnvalue;}
Not sure if this helps but here are my database settings:
I just ran into a strange problem where the cache is not validated properly and I get an outdated value returned. I must have misconfigured something because the cache entries "txnId" is not set, so the validation with the contents of the memory is skipped.
In the code below you can see that if "txnId" is not set, the validation is skipped. Does anyone have an idea how to prevent the txnId from being lost?
Not sure if this helps but here are my database settings:
Thanks in advance for your help.
The text was updated successfully, but these errors were encountered: