日期:2014-05-18 浏览次数:20698 次
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public Event save(Event event) {
try {
logger.info(Thread.currentThread().getName()+":日志新增开始");
if (event.getId() == null) {
this.fillForSave(event);
}
logger.info(Thread.currentThread().getName()+":event开始--新增");
this.eventDao.save(event);
logger.info(Thread.currentThread().getName()+":event结束--新增");
this.follow(event);
logger.info(Thread.currentThread().getName()+":日志新增结束");
return event;
} catch (Exception e) {
e.printStackTrace();
logger.error(Thread.currentThread().getName()+e.getMessage());
return null;
}
}
private void follow(Event event){
logger.info(Thread.currentThread().getName()+":tags开始");
List<Tag> tags = this.tagService.saveTags(event.getClassifications(), TagType.Normal);
logger.info(Thread.currentThread().getName()+":tags结束");
if(tags==null || tags.size()==0){