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. [学习笔记]Linux下mysql的基础操作

    命令 #查看版本 mysql --version   #进入mysql 命令 mysql -u root -p mysql -u root@localhost (没有密码的情况)   #创建数据库 c ...

  2. [学习总结] python语言学习总结 (一)

    还是不多说话了.. 1.eval函数 用法:eval(expression, globals=None, locals=None) 解释:将字符串str当成有效的表达式来求值并返回计算结果. 就是可以 ...

  3. LeetCode分类-前400题

    1. Array 基础 27 Remove Element 26 Remove Duplicates from Sorted Array 80 Remove Duplicates from Sorte ...

  4. IEDA的安装与破解

    百度搜索IDEA 进入官网下载 https://www.jetbrains.com/idea/download/#section=windows 2.下载好双击即可 3. 完成破解

  5. PAT (Basic Level) Practise (中文)- 1009. 说反话 (20)

    http://www.patest.cn/contests/pat-b-practise/1009 给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出. 输入格式:测试输入包含一个测试用例,在 ...

  6. oracle centos 重启后报错ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

    oracle centos 重启后报错ORA-12514, TNS:listener does not currently know of service requested in connect d ...

  7. 配置Xcode的Device Orientation、AppIcon、LaunchImage

    以下图片指出的 TARGETS→General 面板的信息. 下面我们讲讲根据 APP 需求配置我们的Xcode: 1.设置 Device Orientation,指定 APP 支持设备的方向 ,我们 ...

  8. js函数式编程(二)-柯里化

    这节开始讲的例子都使用简单的TS来写,尽量做到和es6差别不大,正文如下 我们在编程中必然需要用到一些变量存储数据,供今后其他地方调用.而函数式编程有一个要领就是最好不要依赖外部变量(当然允许通过参数 ...

  9. css文件和js文件后面带一个问号----2015-1103

    经常看一些网站页面源代码中的css文件和js文件后面带一个问号,后面跟着一连串数字或字符,这是干什么用的? 这个方法我也用过,而且很好用?,它的作用有两个:1.作为版本号,让自己方便记忆.查找:2.作 ...

  10. sql where in字符串问题

    在pycharm中执行 select * from value in(1,2); 会提醒: No statement found under the caret. Execute all statem ...