spring+shrio 用户表事务不起作用问题

告别AT串口线!用STM32F407的USB FS口直连EC800M进行物联网通信 本文介绍了一种创新的物联网通信方案,利用STM32F407的USB FS接口直连EC800M模块,替代传统的AT串口线连接。通过详细的硬件对比、STM32CubeMX配置和USB驱动调试步骤,展示了如何实现更高效的AT指令通信,同时降低硬件复杂度和功耗。 阅读详情

首先说一下,druid数据源真是非常强大,可以配置sql监控,如果不是它,我还不能发现有些对数据库操作没有走事务问题.

大家看下问题


很明显, 有三条sql是没有走事务的, 检查发现这三条都是在shiro Reaml中的sql, 


检查发现, shiro 加载比较早, Reaml中配置的service加载完成后才会加载spring的bean, 事务注解等, 所以此service是配置事务注解是不起作用的,

解决方案: 

 1, Reaml中不配置service, 配置dao, 但问题不能完美解决, 还是有部分sql不走事务.

2, 使用懒加载方式, @Lazy注解, 在第一次使用时加载, 可以完美解决.


在看下sql监控,



全部都走了事务.


【WRF-Chem第二期】WRF-Chem有关 namelist 详解 阅读详情

相关推荐

Mac版Burp Suite专业版破解与汉化完整指南

在Web安全测试领域,Java应用程序的许可证验证机制与本地化实现是常见的技术课题。其原理通常涉及Java Agent技术,通过在JVM启动时动态修改字节码,实现对软件授权状态的校验逻辑进行拦截与重写,从而绕过官方验证。同时,软件界面的国际化(i18n)与本地化(l10n)则依赖于资源文件的替换与加载。从技术价值角度看,深入理解这些机制不仅能满足特定场景下的工具定制需求,更能加深对Java安全机制、软件保护与逆向工程的理解。在实际的工程实践中,安全研究人员与开发者常面临功能受限或语言障碍的挑战,尤其是在渗透

weixin_29327525的博客 1065

SpringBoot+shiro 注解事务不起作用探究

现象: springboot1和shiro 配合时,service中的 @Transactional 不起作用。 一、shiro配置代理引起 Shiro在使用注解的时的配置是: <bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifec...

TrustNature 240

blender中合并的模型,在threejs中显示多个mesh;blender多材质烘培成一个材质

5、优化项(省略此步骤,直接进行步骤6),进入到视图着色方式(此时没有灯光,整体偏暗,如果不调整灯光,烘培出来的材质也偏暗,因此此步骤为优化项,通畅建议调整)。在右边栏进入世界环境,调整颜色。7、烘焙成功之后,新建一个材质,将第三步创建的纹理图像作为材质的纹理,连接到基础色,并把模型的材质改为此材质,其他的材质全部删除。2、处理uv,在侧边栏选择数据-uv贴图,选中使用的uv,进入编辑模式,全选,键盘u,选择智能uv投射。3、处理材质,在侧边栏选择材质,进入着色,在着色器编辑器新建一个图像纹理,新建图像。

AllBluefm的专栏 2530

SpringMVC,Spring,MyBatis,Shrio

//applicationContext.xml &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co...

iteye_3180的博客 138

从申请到落地:解锁OAI骨科数据集的实战指南与避坑经验

本文是一份详尽的OAI骨科数据集实战指南,重点解析了从NDA账号申请、权限审批到数据定位与高效下载的全流程。文章分享了使用login.gov注册、Chrome浏览器避坑、nda-tools命令行批量下载等核心技巧,并总结了常见问题排查方法,旨在帮助医学影像与骨关节炎研究者高效解锁这一宝贵数据资源。

weixin_29313547的博客 328

【光斑定位】空间激光通信、光斑定位、CCD、光斑定位——13000字

0.完整源码获得方式 订阅MATLAB/FPGA教程,免费获得教程案例以及任意2份完整源码 ----------------------------------------------------------------- 空间激光通信是指以光波作为载波进行数据传输的一种通信方式。目前,空间激光通信己成为人们关注的焦点。在空间激光通信系统中,光斑定位是是一项关键技术。 本论文首先对国内外空间激光通信系统的研究现状进行了阐述,论述了空间激光通信的理论只是,并对CCD成像原理,...

FPGA/MATLAB学习教程/源码/项目合作开发 1292

springboot +shiro导致springboot 事务不起作用

springboot +shiro导致springboot 事务不起作用

qq_25137131的博客 412

OpenClaw界面操作手册:命令行与交互模式的正确打开方式

"test": {"description": "运行项目的测试套件","prompt": "请执行项目的测试命令,并分析测试结果。如果有失败的测试,请提供修复建议。},"lint": {"description": "运行代码检查","prompt": "请运行代码检查工具,分析所有警告和错误,并提供修复建议。},"doc": {"description": "为当前文件生成文档","prompt": "请为当前打开的文件生成完整的API文档,包括函数说明、参数描述、返回值类型和使用示例。

gaoxiang_120的专栏 3150

简述shrio认证验证demo

我们都知道shrio是apache官方的一款权限框架 具有认证 权限设置等功能!!今天普及一个小demo 梳理一下shrio的简单使用 我们的demo是基于ssm框架的 所以我们需要配置spring 前面扫描包。。。。。。。。什么的省略 首先我们配置数据源 <bean id="dataSource" class="org.apache.commons.dbcp.BasicData...

Fuyonghui123的博客 262

【AIGC】Qwen3-Embedding:Embedding与Rerank模型新标杆

Qwen3-Embedding:文本嵌入与重排序模型的技术解析与应用实践

一个内容严谨、方向前沿、极具实践价值的AI大模型技术分享站 3102

mapbox 从入门到精通 - 目录

欢迎大家来到gis分享者的《mapbox 从入门到精通》专栏。博主列出学习大纲,如果有什么问题,欢迎留言。

我哎GIS博客 5858

Spring-boot、Shrio实现JWT

关于验证大致分为两个方面: 用户登录时的验证; 用户登录后每次访问时的权限认证 主要解决方法:使用自定义的Shiro Filter 项目搭建: 这是一个spring-boot 的web项目,不了解spring-boot的项目搭建,请google。 pom.mx引入相关jar包 <!-- shiro 权限管理 --> ...

weixin_34113237的博客 152

1 电科院FTU检测标准学习笔记-外观检查

作者简介:本人从事电力系统多年,岗位包含研发,测试,工程等,具有丰富的经验在配电自动化验收测试以及电科院测试中,本人全程参与,积累了不少现场的经验。

sixtome 1852

spring boot事务失效,不生效

spring boot事务不生效 springboot项目中开启事务 1、启动类上加开启事务的注解, 2、在需要事务控制的方法上加上事务注解就可以了生效了 本次事务不生效是因为项目中使用了shrio作为安全认证框架,在shiro中使用到的service接口被提前实例化。没有生成代理对象。 正常是service接口如果配置了事务注解。是由spring 帮我们生成代理对象来调用实际的service,从而进行事务控制 解决方法:在Realm中使用到的service上面加上@Lazy。 ...

FLL430的博客 472

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

shrio框架搭建

1.导入jar包 &amp;amp;lt;!-- shiro --&amp;amp;gt; &amp;amp;lt;dependency&amp;amp;gt; &amp;amp;lt;groupId&amp;amp;gt;org.apache.shiro&amp;amp;lt;/groupId&amp;amp;gt; &amp;amp;lt;artifactId&

guyu96的博客 202

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Shrio整合,验证用户登录信息自用

shrio自用

coldblacktea的博客 134

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

SpringBoot资源下载目录

阅读导航。

本人主攻Java,希望自己能成为出色的程序员。 442

为什么不在spring容器管理controller

Spring容器与SpringMVC容器1.疑问:为什么不用spring去管理所有类?我们配置springMVC 中,为什么controller不直接交给spring 管理而要spring MVC容器单独分开来管理2.Spring容器 与 SpringMVC关系Spring容器与SpringMVC容器是父子关系,子容器可以访问父容器的对象,父容器不能访问子容器的类,如果我们在springMVC配置

L19942013的博客 900

dynamic-datasource-spring-boot-starter和shiro结合 踩坑

dynamic-datasource-spring-boot-starter 基于注解的多数据源,和mybatisPlus搭配,干活不累 一般用到多数据源,大部分是这样: A:共同配置信息的数据库 B:垂直业务信息的数据库 SpringBoot MybatisPlus 下,整合动态多数据源 爆出来: The error may involve defaultParameterMap 总之就是提示找不到这张表。 dynamic-datasource-spring-boot-starter作者给出的解决方案

qq_31775377的博客 591

69道Spring面试题和答案

本文转自至 http://ifeve.com/spring-interview-questions-and-answers/ 目录 Spring 概述依赖注入Spring beansSpring注解Spring数据访问Spring面向切面编程(AOP)Spring MVC Spring 概述 1. 什么是spring? Spring 是个java企业级应用的开源开发框架。

Nothing 375

SMM整合是指将SpringMVC、MyBatis和Spring框架有机地结合在一起,以实现更高效的开发和管理

在SMM整合中,Spring框架充当了粘合剂的角色,通过对象托管的特性,将SpringMVC中的Controller类和MyBatis中的SqlSession类进行管理,简化了人工管理的过程。然后,你需要配置SpringMVC的配置文件(通常是springmvc.xml),在这个文件中,你可以配置SpringMVC的视图解析器、控制器、拦截器等。最后,你需要配置MyBatis的配置文件(通常是mybatis-config.xml),在这个文件中,你可以配置MyBatis的数据源、映射器等。

[Blog][Domain] programb.blog.youkuaiyun.com 791

SSM(spring+springMVC+Mybatis)配置步骤

配置spring-dao.xml文件分为四步骤 1.引入外部文件 2.配置数据源 3.配置sqlSessionFactory对象 4.dao类注入spring容器 配置spring-service.xml文件分为以下三个步骤 1.扫描service类 2.配置事务管理器 3.配置声明式事务 配置spring-redis.xml文件分为以下步骤 1.扫描cache类 2.引入r

红鲤鱼绿鲤鱼的博客 359

Spring+SpringMVC+shiro+mysql(一)

   最近要做个后台管理系统,就会设计到权限的管理控制,于是就想到 shiro ,下面是自己对Spring+shiro的一点点理解,记录下来,一起多探讨: 项目结构   1. pom.xml 配置 1.1. 版本属性信息配置 1 &lt;properties&gt; 2 &lt;!-- base setting --&gt; 3 &l...

javaboy 6575

java框架myba_【SSM架构】Shiro+Spring MVC+MyBatis框架项目班

本套课程一共有四个组成部分:《Spring开发框架》、《MyBatis开发框架》、《Shiro开发框架》、《SSM综合项目——预约系统》,同时本课程讲解中采用了“Eclipse + Maven”的流行组合模式。具体的课程介绍如下。SSM即将成为现在以及以后的WEB开发新模式,并且将长期存在于我们的开发领域之中。SSM框架简介SSM指的是三个框架的简写,分别为:Spring、Shiro、MyBati...

weixin_39717110的博客 234

spring-shiro + ehcache 缓存 配置

实现登录验证、权限验证、缓存存储提高查询效率等功能,主要看思路而不是跑通,这是个真实的项目实例spring-mvc.xml&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;beans xmlns="http://www.springframework.org/schema/beans"      xmlns:xsi="http://www.w3.org...

dongchengxuyuan的博客 8494

springboot 使用shiro后SpringCache失效问题

今天在做Springboot和shiro集成时,发现一个严重的问题。由于shiro的影响,部分service的缓存和事务失效。如下: 1.shiro中使用到service(shiro配置的redis) 2.service中使用到springCache缓存(配置的也是redis) @Service("userService") public class UserServiceImpl implements UserService { @Autowired private UserMappe

weixin_45390688的博客 484
上一篇: JAVA 发送mail 包含附件mail
下一篇: 百度Editor富文本编辑框保存图片路径到项目之外
xxley
博客等级 码龄10年 24粉丝 28原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值