---
title: "identifier of an instance of ……was alter from 2 to null"
author: "aniyo"
date: "2016-03-29T09:32:59Z"
tags: []
categories: ["编程语言"]
slug: "identifier-of-an-instance-of-was-alter-from-2-to-null"
draft: false
lastmod: "2016-03-29T09:32:59Z"
id: 2287005
url: "https://aniyo.iteye.com/blog/2287005"
---

```
Undefined Error: org.hibernate.HibernateException: identifier of an instance of 
com.shkco.adsr3.staticdata.vo.ClientGroup was altered from 2 to null 
```

 

```
List<IClientGroup> clientGroupList = clientGroupService.getAllClientGroup(sessionContext);
		boolean clientGroupValidate = true;
		if(clientGroup != null){
			if(clientGroupList != null){
				for(IClientGroup clientGroups: clientGroupList){
					if(clientGroup.equals(clientGroups.getClientGroupId())){
						clientGroupValidate = false;
						break;
					}
					
				}
			}
			if(Boolean.TRUE.equals(clientGroupValidate)){
				IErrorMessage errorMsg = new ErrorMessage();
				errorMsg.setErrorCode("SUMARAI00035");
				errorMsg.setEnglishMessage("The clientGroup value must be in the DB!");
				errorMsg.setChineseMessage("The clientGroup value must be in the DB!");
				errorMessages.add(errorMsg);
			}
		}
```

 

 

clientGroupService.getAllClientGroup(sessionContext);

缓存问题

使用evict方法请除缓存……![皱眉](http://www.iteye.com/javascripts/tinymce/plugins/emotions/img/smiley-frown.gif "皱眉")