/**
* 通过角色id得到用户帐号
*
* @return
*
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false)
/* @Override */
public String getUAccount(String xzrl) {
String uAccount = userRoleDao.getUAccount(xzrl);
return uAccount;
}
java类org.springframework.transaction.annotation.Isolation的实例源码
UserRoleServiceImpl.java 文件源码
项目:ipayquery
阅读 24
收藏 0
点赞 0
评论 0
UserServiceImpl.java 文件源码
项目:ipayquery
阅读 29
收藏 0
点赞 0
评论 0
/**
* 同步员工信息
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false)
/* @Override */
public int syncStaff() {
userDao.syncUser();
return 1;
}
UserServiceImpl.java 文件源码
项目:ipayquery
阅读 26
收藏 0
点赞 0
评论 0
/**
* 删除用户信息
*/
/* @Override */
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false)
public void deleteUser(String u_id) {
// 删除用户的权限
userRoleDao.deleteRoleByAccount(u_id);
// 删除用户
userDao.deleteUser(u_id);
}
RoleServiceImpl.java 文件源码
项目:ipayquery
阅读 27
收藏 0
点赞 0
评论 0
/**
* 新增角色信息
*
* @param role
* @return
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false)
/* @Override */
public boolean insertRole(Role role) {
if (StringUtil.notEmpty(roleDao.getRoleIdByIdAndName(role.getSystem_id(), null, role.getR_name()))) {
return false;
} else {
roleDao.insertRole(role);
return true;
}
}
RoleServiceImpl.java 文件源码
项目:ipayquery
阅读 26
收藏 0
点赞 0
评论 0
/**
* 更新角色信息
*
* @param role
* @return
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false)
/* @Override */
public String updateRoleBaseInfo(Role role) {
// 系统标志
String system_id = role.getSystem_id();
// 角色ID
String r_id = role.getR_id();
// 角色名称
String r_name = role.getR_name();
String roleIdById = roleDao.getRoleIdByIdAndName(system_id, r_id, null);
String roleIdByName = roleDao.getRoleIdByIdAndName(system_id, null, r_name);
if (StringUtil.isNotEmpty(roleIdById)) {
if (StringUtil.isEmpty(roleIdByName) || roleIdByName.equals(r_id)) {
roleDao.updateRoleBaseInfo(role);
// 更新成功
return "0";
} else {
// 该角色名已存在
return "1";
}
} else {
// 该角色已被删除
return "2";
}
}
RoleServiceImpl.java 文件源码
项目:ipayquery
阅读 23
收藏 0
点赞 0
评论 0
/**
* 更新角色权限
*
* @param role
* @return
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false)
/* @Override */
public boolean updateRoleFunction(Role role) {
if (roleDao.updateRoleFunction(role) > 0) {
// 更新成功
return true;
} else {
// 该角色已被删除
return false;
}
}
RoleServiceImpl.java 文件源码
项目:ipayquery
阅读 24
收藏 0
点赞 0
评论 0
/**
* 删除角色信息
*
* @param r_id
* @return
*/
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false)
/* @Override */
public void deleteRoleById(String r_id) {
roleDao.deleteRoleById(r_id);
}
AccountServiceImpl.java 文件源码
项目:jaf-examples
阅读 24
收藏 0
点赞 0
评论 0
@Override
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
public void transferAmount(String fromUsername, String toUsername, int amount) {
accountDao.subtractAmount(fromUsername, amount);
// int i = 5 / 0; // 模拟抛出异常,测试事务回滚
accountDao.addAmount(toUsername, amount);
System.out.println("transfer amount success");
}
InvoiceAddProductImpl.java 文件源码
项目:Spring-MVC-Blueprints
阅读 27
收藏 0
点赞 0
评论 0
@Transactional(
propagation = Propagation.REQUIRED,
isolation = Isolation.DEFAULT
)
@Override
public void addProduct(InventoryForm invForm) {
Catalog catalog = new Catalog();
catalog.setName(invForm.getName());
catalog.setDescription(invForm.getDescription());
catalog.setCostPrice(invForm.getCostPrice());
catalog.setRetailPrice(invForm.getRetailPrice());
catalog.setWholesalePrice(invForm.getWholeSalePrice());
catalog.setStock(invForm.getStock());
catalog.setTags(invForm.getTags());
catalog.setSupplierId(invForm.getVendor());
Uom uom = new Uom();
uom.setId(invForm.getUomId());
MaterialType type = new MaterialType();
type.setId(invForm.getTypeId());
catalog.setUom(uom);
catalog.setMaterialType(type);
inventoryDao.setProduct(catalog);
}
RuleTagConfigTransactedImpl.java 文件源码
项目:c2mon
阅读 26
收藏 0
点赞 0
评论 0
@Override
@Transactional(value = "cacheTransactionManager", propagation=Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED)
public void doRemoveRuleTag(final Long id, final ConfigurationElementReport elementReport) {
LOGGER.trace("Removing RuleTag " + id);
try {
RuleTag ruleTag = tagCache.get(id);
Collection<Long> ruleIds = ruleTag.getCopyRuleIds();
if (!ruleIds.isEmpty()) {
LOGGER.debug("Removing rules dependent on RuleTag " + id);
for (Long ruleId : ruleIds) { //concurrent modifcation as a rule is removed from the list during the remove call!
if (tagLocationService.isInTagCache(ruleId)) { //may already have been removed if a previous rule in the list was used in this rule!
ConfigurationElementReport newReport = new ConfigurationElementReport(Action.REMOVE, Entity.RULETAG, ruleId);
elementReport.addSubReport(newReport);
ruleTagConfigHandler.removeRuleTag(ruleId, newReport); //call config handler bean so transaction annotation is noticed
}
}
}
tagCache.acquireWriteLockOnKey(id);
Collection<Long> ruleInputTagIds = Collections.EMPTY_LIST;
try {
ruleInputTagIds = ruleTag.getCopyRuleInputTagIds();
Collection<Long> alarmIds = ruleTag.getCopyAlarmIds();
if (!alarmIds.isEmpty()) {
LOGGER.debug("Removing Alarms dependent on RuleTag " + id);
for (Long alarmId : alarmIds) { //need copy as modified concurrently by remove alarm
ConfigurationElementReport alarmReport = new ConfigurationElementReport(Action.REMOVE, Entity.ALARM, alarmId);
elementReport.addSubReport(alarmReport);
alarmConfigHandler.removeAlarm(alarmId, alarmReport);
}
}
for (Long inputTagId : ruleInputTagIds) {
tagConfigGateway.removeRuleFromTag(inputTagId, id); //allowed to lock tag below the rule...
}
for (ConfigurationEventListener listener : configurationEventListeners) {
listener.onConfigurationEvent(ruleTag, Action.REMOVE);
}
configurableDAO.deleteItem(ruleTag.getId());
}
catch (RuntimeException rEx) {
String errMessage = "Exception caught when removing rule tag with id " + id;
LOGGER.error(errMessage, rEx);
throw new UnexpectedRollbackException(errMessage, rEx);
} finally {
if (tagCache.isWriteLockedByCurrentThread(id)) {
tagCache.releaseWriteLockOnKey(id);
}
}
} catch (CacheElementNotFoundException e) {
LOGGER.debug("Attempting to remove a non-existent RuleTag - no action taken.");
elementReport.setWarning("Attempting to removed a non-existent RuleTag");
}
}