0

I am getting error java.lang.UnsupportedOperationException: LOCK_ALL is not implemented for this cache when executing below query. Using Hibernate and Spring MVC. I have done the PofSerializer class for my entity and mapped same in my cache.

@Override
@Transactional
//@Rollback()
//@Transactional()
public List<SetupOptTypeCompatAdmin> updateOptTypeCompat(List<SetupOptTypeCompatAdmin> setupOptTypeCompatAdminEntity)

{

    StringBuilder queryBuffer;
    if (CollectionUtils.isNotEmpty(setupOptTypeCompatAdminEntity))
    {
        for (SetupOptTypeCompatAdmin newSettings : setupOptTypeCompatAdminEntity)
        {
            queryBuffer= new StringBuilder();
            queryBuffer.append("UPDATE SETUP_DFT_OT_COMPAT SET COMPAT_IND='T'");
            queryBuffer.append(" WHERE SETUP_DFT_OT_BRAND_ID="+newSettings.getBrandID()+" AND OPTION_TYPE_COMPAT_ID="+newSettings.getOptTypeCompatID()+" AND");
            queryBuffer.append(" OPTION_TYPE_ID="+newSettings.getOptTypeID() +" AND COMPAT_IND='F'");
            try{

             entityManager.createNativeQuery(queryBuffer.toString()).executeUpdate();
            //entityManager.createQuery(queryBuffer.toString()).executeUpdate();
            //entityManager.getLockMode(paramObject)
            }
            catch(Exception ex)
            {
                LOGGER.error("Error in entityManager.createNativeQuery" + ex);
            }

        }
    }
    //List<SetupOptionDefaultValues> optionValIdList = (List<SetupOptionDefaultValues>) entityManager.createNativeQuery(queryBuffer.toString(), SetupOptionDefaultValues.class).getResultList();
    return setupOptTypeCompatAdminEntity;

}
khelwood
  • 55,782
  • 14
  • 81
  • 108
  • I guess , message is clear enough that your cache doesn't support `LOCK_ALL`. Are you doing `cache.lock(LOCK_ALL)` at app start up? – Sabir Khan Dec 21 '15 at 17:37
  • Nope. Even i dont know how to do. SetupOptTypeCompatAdmin is new entity class i have done and created pof for the same. configured same in cache config. i have checked my whole project with the word LOCK_ALL. nothing i got. – user2578580 Dec 22 '15 at 13:58
  • Edit question to show cache config and cache details. Also point in code as which line throws exception. Some commented lines in code creating confusion , paste only code that you are executing. Which app server is being used and how that server getting started? I mean, is it clustered environment or single server instance? – Sabir Khan Dec 22 '15 at 14:03

0 Answers0