spring-transaction-basic

本文详细介绍了Spring框架中事务管理的实现方式,包括基于AOP的自动代理创建、事务顾问配置、事务拦截器的工作原理及事务切入点的具体实现路径。

Spring的事务本身是基于AOP的

 

AOP代理自动创建器:InfrastructureAdvisorAutoProxyCreator

beanname:org.springframework.aop.config.internalAutoProxyCreator

 

事务AOPBeanFactoryTransactionAttributeSourceAdvisor

beanName: org.springframework.transaction.config.internalTransactionAdvisor:

 

 

事务advice:TransactionInterceptor: beanName:org.springframework.transaction.interceptor.TransactionInterceptor#0

 

事务PointCut:TransactionAttributeSourcePointcut-> AnnotationTransactionAttributeSource->TransactionAnnotationParser->SpringTransactionAnnotationParser

 

 

org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: java.sql.SQLSyntaxErrorException: ORA-00904: "JOTRC"."POT_CODE": 标识符无效 ### The error may exist in file [F:\qdport-workspace\shpms-api\shpms-service\shpms-core\target\classes\mybatis\basic\OilPotCodeMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT * FROM JC_OIL_POT_CODE JOPC WHERE JOTRC.POT_CODE = ? ### Cause: java.sql.SQLSyntaxErrorException: ORA-00904: "JOTRC"."POT_CODE": 标识符无效 ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00904: "JOTRC"."POT_CODE": 标识符无效 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) ~[spring-jdbc-5.3.27.jar:5.3.27] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) ~[spring-jdbc-5.3.27.jar:5.3.27] at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) ~[mybatis-spring-2.0.0.jar:2.0.0] at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) ~[mybatis-spring-2.0.0.jar:2.0.0] at com.sun.proxy.$Proxy146.selectList(Unknown Source) ~[na:na] at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) ~[mybatis-spring-2.0.0.jar:2.0.0] at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:168) ~[mybatis-plus-core-3.1.0.jar:3.1.0] at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:82) ~[mybatis-plus-core-3.1.0.jar:3.1.0] at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) ~[mybatis-plus-core-3.1.0.jar:3.1.0] at com.sun.proxy.$Proxy228.getOilPotByPotNo(Unknown Source) ~[na:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_351] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_351] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_351] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_351] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.27.jar:5.3.27] at com.baomidou.dynamic.datasource.aop.DynamicDataSourceAnnotationInterceptor.invoke(DynamicDataSourceAnnotationInterceptor.java:50) ~[dynamic-datasource-spring-boot-starter-3.5.2.jar:3.5.2] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:220) ~[spring-aop-5.3.27.jar:5.3.27] at com.sun.proxy.$Proxy229.getOilPotByPotNo(Unknown Source) ~[na:na] at com.juyuansoft.shpms.basic.service.impl.OilPotCodeServiceImpl.getOilPotByPotNo(OilPotCodeServiceImpl.java:135) ~[classes/:na] at com.juyuansoft.shpms.basic.service.impl.OilPotCodeServiceImpl$$FastClassBySpringCGLIB$$1cbc3700.invoke(<generated>) ~[classes/:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.27.jar:5.3.27] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.27.jar:5.3.27] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.27.jar:5.3.27] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.27.jar:5.3.27] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.27.jar:5.3.27] at com.baomidou.dynamic.datasource.aop.DynamicDataSourceAnnotationInterceptor.invoke(DynamicDataSourceAnnotationInterceptor.java:50) ~[dynamic-datasource-spring-boot-starter-3.5.2.jar:3.5.2] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.27.jar:5.3.27] at com.juyuansoft.shpms.basic.service.impl.OilPotCodeServiceImpl$$EnhancerBySpringCGLIB$$e4443616.getOilPotByPotNo(<generated>) ~[classes/:na] at com.juyuansoft.shpms.dispatch.service.impl.IoStatisticsServiceImpl.oilcanIoList(IoStatisticsServiceImpl.java:236) ~[classes/:na] at com.juyuansoft.shpms.dispatch.service.impl.IoStatisticsServiceImpl.ioStatisticsNewList(IoStatisticsServiceImpl.java:80) ~[classes/:na] at com.juyuansoft.shpms.dispatch.service.impl.IoStatisticsServiceImpl$$FastClassBySpringCGLIB$$d8e7a23b.invoke(<generated>) ~[classes/:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.27.jar:5.3.27] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.27.jar:5.3.27] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.27.jar:5.3.27] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.27.jar:5.3.27]
最新发布
10-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值