当调用一个命令reset operations 时候启动4个线程 做一些操作.
这个重复命令执行大约运行七八次,assetMove.getAssetType().getType()就会返回一次nullpointerException.
public TmEquipmentType getAssetType() {
return (_asset != null) ? _asset.getType() : _containerPlanEquipmentType.getEquipmentType();
}
TmAssetMoveImpl.hbm.xml
<many-to-one name="containerPlanEquipmentType"
class="com.redprairie.tm.core.TmContainerPlanEquipmentTypeImpl" >
<column name="container_plan_equip_id" />
</many-to-one>
TmContainerPlanEquipmentTypeImpl.hbm.xml
<many-to-one name="equipmentType"
class="com.redprairie.tm.assets.TmEquipmentTypeImpl">
<column name="equip_typ" />
</many-to-one>
我改了下assetMove.getAssetType() 进行debug, assetMove.getAssetType()明明能看到值, 但是调用它的属性的时候就会Nullpointer.
起初运行 五六次命令会出现一次异常, 后来改来将
containerPlanEquipmentType.getEquipmentType()
set和get方法同步一下 运行一百次命令出现一次异常.
难道和hibernate的lazy 或者什么其他设置有关?