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
Hello,
I am currently facing issue while using ehcache along with transaction
The settings of my application as goes below:
The main method Which I am making as transactional:
@Transactional(isolation=Isolation.REPEATABLE_READ,readOnly=true)
public ItemInquiryResponse inquireItem(ItemInquiryRequest request) {
//Some codes goes here to call n number of services
like
Unit unit = unitMapper.getUnit(Unit);
}
Here unitMapper, is a mapper class for Mybatis which is a interface and
initialized from the spring Context.
and in the getUnit() I did like this:
@Transactional(isolation=Isolation.READ_UNCOMMITTED, readOnly=true)
public interface UnitMapper {
@Cacheable(cacheName="com.sears.dos.ordermgmt.UNIT_CACHE",
keyGenerator = @KeyGenerator (name = "StringCacheKeyGenerator",
properties = {
@Property( name="useReflection", value="false" ), @Property( name="checkforCycles", value="false" ),
@Property( name="includeMethod", value="false" )
}
)
)
public Unit getUnit(Unit unit);
}
Initially, I was facing issue like, on the first call of
Unit unit = mapper.getUnit()
then I am trying to play with this unit object, It was getting corrupted in
ehcache , So from the code level I am taking care of that, not to touch the
persisted object.
When I am removing @Tranaction from the main method, the EhCache is working
fine, While I including it seems to be not picking anything from cache.
My basic key understanding is, every method after execution should get cached
regardless of transaction, when second time with same parameter I am trying to
make call it should return me from the cache.
While this is not happening in my case.
I tried to look into logs of ehcache, but that didn't help me much.
Please do note all my objects are singeltone and all mapperinterfaces objects
are instance variable and geting set by Spring IOC of setter injection,
Please assist me on this ASAP.
your help is appreciated.
Thanks,
Jayaram.
Original issue reported on code.google.com by [email protected] on 28 Oct 2011 at 6:55
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 28 Oct 2011 at 6:55The text was updated successfully, but these errors were encountered: