One more point to add is teh listener is asynch @Listener(sync = false).
Also in the cacheModified event , the updated valued is not directly accesible through apis , hence i use event.getCache().get(event.getKey()) to get the value.
I figured out why this was happening.
Since the listener was asynchronous and isolation mode was repetable reads, before teh transaction committed it was always retruning old value. When i put a delay of 100 milliseconds , teh commit woudl go ahead and i woudl get new values.
So i figured out the that i shoudl not be accessing values from teh cache , instead i shoudl be using the Cache Modified event or Cacheremoved event, which will give teh new value. But i have issue with teh getting the value for cache created event (which i will post as seperate thread).
Thanks you for the confirmation for cache modified entries.
How exactly do i access teh cache entry for cache created event ? (i have posted this as a seperate thread https://community.jboss.org/thread/177541?tstart=0 )
Sicne i am using tansactions , i need to get teh element and use this on successful transaction commit.