在同一集群中运行的 Web 应用程序之间共享事务
我们(将)拥有以下架构:
Base.war
将是一个独立的 spring-hibernate 应用程序- 所有应用程序都将在 Glassfish 下运行,并且可能是集群
E1.war
将位于Base.war
之上,扩展其功能- 可能还有进一步的扩展(
E2.war
、E3.war< /code>, …) 坐在
Base.war
之上 - 战争可以启动交易,并且交易可以在战争之间跨越,
- 而无需关闭
Base.war
或任何其他E
x.war
,应该可以升级E
y< code>.war
在 spring-hibernate-glassfish 环境中是否有解决方案?
We (will) have the following architecture:
Base.war
will be a self-contained spring-hibernate application- All applications will run under Glassfish, and may be clustered
E1.war
will sit on top ofBase.war
, extending it's functionality- There could be further extensions (
E2.war
,E3.war
, …) sitting on top ofBase.war
- Either wars could start a transaction, and transactions could span between wars
- Without shutting down
Base.war
, or any otherE
x.war
, it should be possible to upgrade anE
y.war
Is there a solution for this with spring-hibernate-glassfish environment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问自己/团队的问题:
我将回到第 4 点——不要进行分布式事务。您需要真正确定分布式事务是最适合您的解决方案。这并不简单,建议尽可能避免它们。这直接来自 Spring 联合创始人兼高级开发人员 Jürgen Höller。
Spring 不支持在进程之间传播事务,因此您需要容器来支持此操作或自己手动执行此操作。
Questions to ask yourself/team:
I'll return to point 4 - don't do distributed transactions. You need to be really sure that distributed transactions are the best solution for you. It isn't simple and the recommendation is to avoid them, if possible. This comes straight from Jürgen Höller, co-founder and senior developer at Spring.
Spring has no support for propagating transactions between processes, so you'll need the container to support this or manually do this yourself.