package org.springframework.transaction.support;

import org.springframework.transaction.NestedTransactionNotSupportedException;
import org.springframework.transaction.SavepointManager; public class DefaultTransactionStatus extends AbstractTransactionStatus
{
private final Object transaction;
private final boolean newTransaction;
private final boolean newSynchronization;
private final boolean readOnly;
private final boolean debug;
private final Object suspendedResources; public DefaultTransactionStatus(Object transaction, boolean newTransaction,
      boolean newSynchronization, boolean readOnly, boolean debug, Object suspendedResources)
{
this.transaction = transaction;
this.newTransaction = newTransaction;
this.newSynchronization = newSynchronization;
this.readOnly = readOnly;
this.debug = debug;
this.suspendedResources = suspendedResources;
} public Object getTransaction()
{
return this.transaction;
} public boolean hasTransaction()
{
return this.transaction != null;
} public boolean isNewTransaction() {
return (hasTransaction()) && (this.newTransaction);
} public boolean isNewSynchronization()
{
return this.newSynchronization;
} public boolean isReadOnly()
{
return this.readOnly;
} public boolean isDebug()
{
return this.debug;
} public Object getSuspendedResources()
{
return this.suspendedResources;
} public boolean isGlobalRollbackOnly()
{
return ((this.transaction instanceof SmartTransactionObject)) && (((SmartTransactionObject)this.transaction).isRollbackOnly());
} protected SavepointManager getSavepointManager()
{
if (!isTransactionSavepointManager()) {
throw new NestedTransactionNotSupportedException("Transaction object [" + getTransaction() + "] does not support savepoints");
} return (SavepointManager)getTransaction();
} public boolean isTransactionSavepointManager()
{
return getTransaction() instanceof SavepointManager;
}
}

DefaultTransactionStatus源码的更多相关文章

  1. spring jdbctemplate源码跟踪

    闲着没事,看看源码也是一种乐趣! java操作数据库的基本步骤都是类似的: 1. 建立数据库连接 2. 创建Connection 3. 创建statement或者preparedStateement ...

  2. Spring各种传播特性源码实现的概览

    这几天都在分析Spring的源码实现,看到事务管理的部分 我们知道事务的传播特性有下面几种,我标黄的就是最常用的3中传播特性, Sping在发生事务嵌套的时候,会依据内层事务的传播特性,来决定内层是事 ...

  3. spring事务源码解析

    前言 在spring jdbcTemplate 事务,各种诡异,包你醍醐灌顶!最后遗留了一个问题:spring是怎么样保证事务一致性的? 当然,spring事务内容挺多的,如果都要讲的话要花很长时间, ...

  4. Spring事务源码阅读笔记

    1. 背景 本文主要介绍Spring声明式事务的实现原理及源码.对一些工作中的案例与事务源码中的参数进行总结. 2. 基本概念 2.1 基本名词解释 名词 概念 PlatformTransaction ...

  5. spring事务源码分析结合mybatis源码(一)

    最近想提升,苦逼程序猿,想了想还是拿最熟悉,之前也一直想看但没看的spring源码来看吧,正好最近在弄事务这部分的东西,就看了下,同时写下随笔记录下,以备后查. spring tx源码分析 这里只分析 ...

  6. spring事务详解(三)源码详解

    系列目录 spring事务详解(一)初探事务 spring事务详解(二)简单样例 spring事务详解(三)源码详解 spring事务详解(四)测试验证 spring事务详解(五)总结提高 一.引子 ...

  7. 框架源码系列十一:事务管理(Spring事务管理的特点、事务概念学习、Spring事务使用学习、Spring事务管理API学习、Spring事务源码学习)

    一.Spring事务管理的特点 Spring框架为事务管理提供一套统一的抽象,带来的好处有:1. 跨不同事务API的统一的编程模型,无论你使用的是jdbc.jta.jpa.hibernate.2. 支 ...

  8. Springboot源码分析之事务拦截和管理

    摘要: 在springboot的自动装配事务里面,InfrastructureAdvisorAutoProxyCreator ,TransactionInterceptor,PlatformTrans ...

  9. Spring系列(六):Spring事务源码解析

    一.事务概述 1.1 什么是事务 事务是一组原子性的SQL查询,或者说是一个独立的工作单元.要么全部执行,要么全部不执行. 1.2 事务的特性(ACID) ①原子性(atomicity) 一个事务必须 ...

随机推荐

  1. Python+selenium之测试报告(1)

    一.下载HTMLTestRunner.py HTMLTestRunner 是 Python 标准库的 unittest 模块的一个扩展.它生成易于使用的 HTML 测试报告.HTMLTestRunne ...

  2. Html style="visibility:hidden"与style="display:none"的区别

    style="visibility:hidden": 使对象在网页上隐藏,但该对象在网页上所占的空间没有改变. style="display:none": 使对 ...

  3. 洛谷 P2002 消息扩散

    题目背景 本场比赛第一题,给个简单的吧,这 100 分先拿着. 题目描述 有n个城市,中间有单向道路连接,消息会沿着道路扩散,现在给出n个城市及其之间的道路,问至少需要在几个城市发布消息才能让这所有n ...

  4. JDBC + SAP云平台 = 运行在云端的数据库应用

    在前一篇文章JPA + EclipseLink + SAP云平台 = 运行在云端的数据库应用我介绍了如何通过JPA和EclipseLink操作部署在SAP云平台上的HANA数据库实例. 在这篇文章里, ...

  5. cesium-大规模人群运动测试

    环境:cesium1.57: 笔记本电脑:集成显卡+独显Navida 1060 测试内容:大规模人群运动(500人,可设置运动的路径),可行性及帧率 测试结果:21-23FPS,较为流畅:集显70%- ...

  6. VMware的centos的配置分区

    /      ext3 8189 固定大小空     swap 509  固定大小/boot  ext3 100  固定大小/home  ext3 全部(使用全部可用空间) 利用的工具   AMFTP ...

  7. Servlet的引入(即加入Servlet)

    今天讲的Servlet是根据上一章节<创建一个学生信息表,与页面分离>而结合. 一.看图分析 此模式有问题: 1.jsp需要呼叫javabean StudentService stuSer ...

  8. Slasher Flick-freecodecamp算法题目

    Slasher Flick(截断数组) 要求 返回一个数组被截断n个元素后还剩余的元素,截断从索引0开始. 思路 利用.splice(0,howMany)删除数组中索引从0开始的howMany个元素 ...

  9. 2018 noip 提高组初赛参考答案

    这里有pdf文件:戳这儿

  10. linux关于进程、内存和cpu情况

    1.load average: 2.03, 1.76, 1.80 1分钟.5分钟.15分钟平均负载 2.%Cpu(s):100.0 us, 0.0 sy, 0.0 ni, 0.0 id, 0.0 wa ...