There are several patterns you can take when you have faced with balances on transaction management, especially when you are using spring framework to do such things. The idea is not mine, I just give a brief note here, although I have used some patterns myself, but I didn't name them.
I start from the simplest pattern.
-
Wing-And-A-Prayer Pattern
this is a type of anti-pattern or worse practice, it means, you manage transaction on A resource, but data access on B resource, in chinese "驴唇不对马嘴", :-)
-
Shared Transaction Resources Pattern
the data access request are sent to resource A, the transaction are managed against resource A too, that's, the normal situation, right?
-
Non-Transactional Access Pattern
we have 2 or more resources, in this pattern, we only guarantee ONE long transaction against one of the resources, as to data access requests against other resources, we let them go ( auto commit, as u see).
we have 2 or more resources too, just like the scenario in Non-Transactional Access Pattern, but only guarantee ONE long transaction is not enough, and we don't want to use XA distributed transaction management either, so what we do?
In Best Efforts 1PC Pattern, we start all of the local transaction against each resources we manage, we commit or rollback them all as per situation, but don't guarantee the data integration when errors occurs at the point of commit or rollback, there is only 1 phase commit and we do our best to make sure the transactions to be managed properly, that's why it's called Best Efforts 1 PC Pattern.
-
XA 2PC Distributed Transaction Pattern
it's natural to resort to XA 2PC Distributed Transaction Pattern when the transaction involves more resources, we all know it, but we also know that XA 2PC distributed transaction brings performance penalty too.
So, you see, no matter which pattern you choose, choose one that's suitable to your scenario!
BTW, Taobao guys have another solution for transaction management, but their solution is specific to their scenario too, so pick the one that 's best suitable to you.
分享到:
相关推荐
Business Transaction Management (BTM) 是一个关键的IT监控领域,主要关注的是确保企业交易的顺畅进行,特别是对于那些金融和交易环境来说,其中延迟监控至关重要。BTM的主要目标包括以下几个方面: 1. **性能监控...
Bertsimas, D. , & Pachamanova, D. (2008). Robust multiperiod portfolio management in the presence of transaction costs. Computers & Operations Research, 35 , 3–17 .
### 标题解读:DSI402+Space+and+Transaction+Management 该标题暗示了文档主要关注Oracle数据库内部如何进行空间管理及事务管理,这两个领域对于确保数据库高效运行至关重要。空间管理主要涉及存储空间的有效利用...
sap press doc 解压密码:abap_developer
本项目"Simple Banking Management System in Python using Django"就是一个很好的实例,它展示了如何利用Python的Django框架来构建一个基本的银行管理系统。 Django是一个免费且开源的Web应用框架,遵循模型-模板-...
对于事务日志的监控和管理,可以采取一系列的技术措施,例如:设置合适的日志文件大小,监控日志文件的增长速度,利用SQL Server Management Studio (SSMS) 或其他第三方监控工具来观察日志的使用情况。在某些情况下...
赠送jar包:javax.transaction-api-1.2.jar; 赠送原API文档:javax.transaction-api-1.2-javadoc.jar; 赠送源代码:javax.transaction-api-1.2-sources.jar; 赠送Maven依赖信息文件:javax.transaction-api-1.2....
一个站点可以是一个InSite Server,也可以是共享一个Transaction数据库的多个InSite Server构成的集群。 在Management Studio中,可以执行多项任务,包括但不限于定义ODBC数据源、管理站点、管理InSite Server...
【javax.transaction.jar】是Java平台上的一个核心组件,主要用于处理分布式环境中的事务管理。这个库包含了一组接口和类,这些接口和类定义了事务管理的API,使得开发者能够在Java应用程序中实现事务处理的规范。在...
赠送jar包:javax.transaction-api-1.2.jar; 赠送原API文档:javax.transaction-api-1.2-javadoc.jar; 赠送源代码:javax.transaction-api-1.2-sources.jar; 赠送Maven依赖信息文件:javax.transaction-api-1.2....
2.1.4 The Semistructured Model in Brief 2.1.5 Other Data Models 2.1.6 Comparison of Modeling Approaches 2.2 Basics of the Relational Model 2.2.1 Attributes 2.2.2 Schemas 2.2.3 Tuples ...
之前一直找原因,最后知道了解决方法,具体请下载源码查看。特别是用到throw的事务中
本篇文章将深入探讨Spring的事务管理机制,特别是如何实现事务的挂起(Transaction Suspension),并展示如何利用Spring的声明式事务管理来处理POJO(Plain Old Java Object)对象,同时使用JTA(Java Transaction ...
CALL TRANSACTION USING 参数详解 CALL TRANSACTION USING 语句是 ABAP 中提供的一个方便的执行批量输入的语句,使用它可以通过程序代码完成多个事务码的连续执行。BDC_TAB 是批输入任务表,网上有很多例子了,大家...
本文将深入研究Hibernate中的`Session`和`Transaction`,这两个概念是理解Hibernate工作原理的关键。 首先,让我们了解`Session`。在Hibernate中,`Session`充当了应用程序与数据库之间的桥梁,它是持久化操作的...
* TLP:Transaction Layer Packet * DLLP:Data Link Layer Packet * BIOS:Basic Input Output System * UDE:USB Device Emulation 学习目标 * 了解PCIE Power Management的基本概念 * 了解PCIE Power ...
实例操作,中英界面对照,将ABAP自己的T-CODE挂到webui上去,实现在webui上打开GUI报表功能
根据提供的文件信息,可以提炼出以下与“Principles of transaction processing”相关的知识点: 1. 事务处理的原理 事务处理系统是计算机系统的一个重要组成部分,它涉及到如何高效、安全地处理各种事务。事务处理...