• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB cache incosistecy across JVM  RSS feed

Chetana Mumbaikar
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am facing data inconsistency with EJB2.1 Implementation. We are using WAS6.1 with 2 JVMs per channel (we have 5 channels and two app server so total 20 JVMS). To avoid load on DB we are caching data into JVM. However it happens that for one cache type one JVM has 30 records and other JVM gets 28 records.
e.g below are the entries exist in DB

code todate fromdate
ABC 2099-12-31 2014-12-31
ABC 2014-12-30 2014-06-12
ABC 2014-06-11 2013-08-21

They are stored in Map1 as key=code and value=Map2 {key=fromdate, value=entire code object)

ABC={2014-12-31=code:ABC fromdate:2014-12-31 todate:2099-12-31, 2014-06-12=ticketType:ABC fromdate:2014-06-12 todate:2014-12-30, 2013-08-21=ticketType:ABC fromdate:2013-08-21 todate:2014-06-11}

After debugging we found that for missing records code is looping previously fetched record again. Say in first attempt for code ABC it reads fromdate as 2014-12-31 then in next attempt it reads again 2014-12-31, so it miss one record.

If we run loadcache job again then this issue gets resolved. Its happening on intermittent basis.

We are using EJB2.1 with CMP2.x. As we are using container managed persistence, code is auto generated at deployment time.

Can you please let me know if this is known behaviour of CMP for distributed env or any solution to fix it.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!