Book
关于
标签
分类
读书笔记
人性的枷锁
酒国
消息队列
kafka
rocketmq
rabbitmq
redis
Spring
控制反转(IOC)/依赖注入(DI)
ApplicationContext 容器
SSM 框架整合
Spring Boot
应用上下文配置类(ConfigurableApplicationContext)
核心注解(@SpringBootApplication)
自动配置类加载(@EnableAutoConfiguration)
自动导入包(@AutoConfigurationPackage)
类导入(@Import)
条件导入(@Conditional)
全局配置(application.properties)
多环境配置切换
属性加密
日志配置
属性松散绑定规则
全局配置属性注入
逐个注入(@Value)
批量注入(@ConfigurationProperties @EnableConfigurationProperties)
请求拦截(HandlerInterceptor & Filter & @WebFilter)
前后端数据交互对接
全局响应体处理器(ResponseBodyAdvice)
取消封装
响应体空值处理
全局异常处理类
事务
TransactionManager 事务管理器
事务属性
事务状态
声明式事务(xml & 注解)
配置xml方式
创建事务管理器
使用注解方式(@Transactional)
环绕通知使用事务(@Around)
编程式事务(TransactionTemplate & PlatformTransactionManager)
面试题
1.Java基础面试题
2.Spring 面试题
3.数据库面试题
4.中间件面试题
5.运维面试题
6.场景题
7.算法题
大语言模型
运维
软件测评
开源测评
系统设计最佳实践
QA
安装部署
编程式事务(TransactionTemplate & PlatformTransactionManager)
Spring提供了对编程式事务和声明式事务的支持,编程式事务允许用户在代码中精确定义事务的边界,而声明式事务(基于AOP)有助于用户将操作与事务规则进行解耦。 简单地说,编程式事务侵入到了业务代码里面,但是提供了更加详细的事务管理;而声明式事务由于基于AOP,所以既能起到事务管理的作用,又可以不影响业务代码的具体实现 Spr ...
2022-11-28
Spring
环绕通知使用事务(@Around)
环绕通知可以在目标方法的前和后都能增强功能,不需要修改代码代码 spring给业务方法在执行时,增加上事务的切面功能,在添加环绕事务方法 示例 @Pointcut("@annotation(com.exi.dao.Permissions)") ...
2022-11-28
Spring
使用注解方式(@Transactional)
使用AspectJ AOP的注解方式@Transactional @Transactional有以下参数 参数 描述 ...
2022-11-28
Spring
创建事务管理器
JDBC事务 如果应用程序中直接使用JDBC来进行持久化,DataSourceTransactionManager会为你处理事务边界。为了使用DataSourceTransactionManager,你需要使用如下的XML将其装配到应用程序的上下文定义中: 示例 <bean id="transactionManager"class="org.springframework.jdbc.data ...
2022-11-28
Spring
配置xml方式
Spring中xml中配置事务属性有两种方式: 使用AspectJ AOP中的tx标签定义切面对象事务的属性 直接在事务代理(TransactionProxyFactoryBean)中添加属性 使用事务拦截器(TransactionInterceptor)批量处理 ...
2022-11-28
Spring
声明式事务(xml & 注解)
Spring配置文件中关于事务配置总是由三个组成部分,分别是DataSource、TransactionManager和代理机制这三部分,无论哪种配置方式,一般变化的只是代理机制这部分。 DataSource、TransactionManager这两部分只是会根据数据访问方式有所变化,比如使用Hibernate进行数据访问时,DataSource实际为Sessi ...
2022-11-28
Spring
事务状态
调用PlatformTransactionManager接口的getTransaction()的方法得到的是TransactionStatus接口的一个实现,这个接口的内容如下 接口方法 ...
2022-11-28
Spring
事务属性
TransactionDefinition类中定义了,事物的基本属性,事务属性可以理解成事务的一些基本配置,描述了事务策略如何应用到方法上。 事务属性包含了5个方面 TransactionDefinition接口方法内容如下 方法 ...
2022-11-28
Spring
事务
事务是一系列的动作,它们综合起来是一个完整的工作单元,这些动作必须全部完成,如果有一个失败的话,那么事务就会回滚到最开始的状态 事务有四个特性 原子性(Atomicity):事务是一个原子操作,由一系列动作组成。事务的原子性确保动作要么全部完成,要么完全不起作用。 ...
2022-11-28
Spring
SSM 框架整合
SSM框架是指整合SpringMVC+ Spring + MyBatis三个框架的优势功能。三个框架对应的三层架构的三层。 SpringMVC是视图层 Spring是业务层 MyBatis持久层 ...
2022-06-28
Spring
>
Spring MVC
>
MyBatis
1
2
>