【发布时间】:2016-03-08 04:30:43
【问题描述】:
我有一个需要写入多个数据库的要求。如果在写入任何数据库时发生任何异常,我想回滚所有内容。
例如
Session userSession= a.getUserDBSession();
Session departmentSession= a.getDepartmentSession();
Session carSession= a.getCarSession();
//Do some work and write to User DB
// Do some work and write to Department DB
//Do some work and write to Car DB
// commit everything.
注意:会话是休眠会话 任何帮助将不胜感激
【问题讨论】:
标签: java hibernate jdbc transactions hibernate-session