用于多个数据库的事务管理使用Spring&过冬 [英] Transaction management for multiple database Using Spring & Hibernate

查看:101
本文介绍了用于多个数据库的事务管理使用Spring&过冬的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想出一个Spring& Hibernate应用程序的插入/更新到自己的系统数据库,它甚至必须插入/更新其他系统与不同的数据库类型。

我怎样才能实现事务管理Hibernate在执行不同的数据库时。



-Bharat

解决方案

您正在寻找涉及多个数据源的交易,我强烈建议您在David Syer(spring lead)的选项中提供以下系列文章:

http:// www。 javaworld.com/article/2077963/open-source-tools/distributed-transactions-in-spring--with-and-without-xa.html



例如,有些数据库甚至在某些情况下支持跨数据库模式的事务,而没有分布式事务(参见 here ) p>

除XA两阶段提交事务管理器之外,还有其他选择(因为它们引入了大量开销和复杂性),但涉及不同的权衡。 b

Am coming up with a Spring & Hibernate application which has Inserts/Update to its own system database and it even has to Insert/update other systems with different database types.

How can i achieve the transaction management with Hibernate while performing with different databases.

-Bharat

解决方案

Assuming you are looking for transactions involving multiple datasources, I highly recommend you give this series of posts by David Syer (spring lead) on your options:

http://www.javaworld.com/article/2077963/open-source-tools/distributed-transactions-in-spring--with-and-without-xa.html

For example, some databases even support transactions across databases schemas under certain circumstances without distributed transactions (see here).

There are other options other than XA 2-phase commit transaction managers (as they introduce significant overhead and complexity) but they involve different trade-offs.

这篇关于用于多个数据库的事务管理使用Spring&过冬的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆