java.lang.UnsupportedOperationException:此缓存未实现LOCK_ALL

时间:2015-12-21 16:16:58

标签: java spring hibernate caching entitymanager

执行以下查询时,我收到错误java.lang.UnsupportedOperationException: LOCK_ALL is not implemented for this cache。使用Hibernate和Spring MVC。我为我的实体完成了PofSerializer类,并在缓存中映射了它。

@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;

}

0 个答案:

没有答案