问题描述
- ssh声明式事物为什么不能绑定
-
我配置spring声明式事物为*Server
我的登陆方法为login没有在事物的范围呢,但里面的getUserInfo在事物范围内,
那么只有get*的话就没有被绑定到线程中,只有配置login才行。为什么?PROPAGATION_REQUIRED,-java.lang.Throwable
PROPAGATION_REQUIRED,-java.lang.Throwable
PROPAGATION_REQUIRED,-java.lang.Throwable
PROPAGATION_REQUIRED,-java.lang.Throwable
PROPAGATION_REQUIRED,-java.lang.Throwable
PROPAGATION_REQUIRED,-java.lang.Throwable,readOnly
PROPAGATION_REQUIRED,-java.lang.Throwable,readOnly
PROPAGATION_REQUIRED,-java.lang.Throwable
public Map<String,Object> login(String userName,String passWord) throws ServiceException { Map<String,Object> infoMap = new HashMap<String, Object>(); Boolean isOk = false;//是否登陆成功 try { BaseUser user = getUserInfo(userName); passWord = Md5.md5(passWord); isOk = isPasswdOk(user,passWord); infoMap.put("isOk",isOk);//是否登陆成功 if(isOk){ infoMap.put("BaseUser",user); } } catch (DaoException e) { infoMap.put("isOk",isOk); throw new ServiceException("登录service error",e.getCause()); } return infoMap; } public BaseUser getUserInfo(String userName) throws DaoException { return userDao.getUserInfoByName(userName); }
解决方案
http://ask.csdn.net/questions/11511
时间: 2024-09-12 16:41:37