0

我有一个需要写入多个数据库的要求。如果在写入任何数据库时发生任何异常,我想回滚所有内容。

例如

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.

注意:会话是休眠会话任何帮助将不胜感激

4

1 回答 1

0

您可以尝试将 Atomikos 与休眠一起使用。

检查以下链接。

http://www.atomikos.com/Documentation/HibernateThreeStandalone

于 2016-03-08T05:32:07.723 回答