Hi Alex,

I have a question in regard to class 
ReadWriteEhcacheNaturalIdRegionAccessStrategy where you are listed as co-author.
Do you maybe know, why inserts do only succeed if there is no existing value 
mapped to the actual key?

Code-snippet of ReadWriteEhcacheNaturalIdRegionAccessStrategy#afterInsert

<< if ( item == null ) {
<<     region.put( key, new Item( value, null, region.nextTimestamp() ) );

Namely I did expect, that in case of item being an "unlocked" Lock, the insert 
should succeed nonetheless.
Something like following:

>> if ( item == null || item.isWriteable( region.nextTimestamp(), null, null ) 
>> ) {
>>    region.put( key, new Item( value, null, region.nextTimestamp() ) );

I ask because after trying to resolve a Todo in StatefulPersistenceContext (you 
find it by searching for "should be using access strategy, not plain evict.. 
"), 
some test in CachedMutableNaturalIdStrictReadWriteTest fails exactly because 
such "re-caching" attempts do not succeed anymore.

best regards
Guenther Demetz


_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to