<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Spring on 艺术码农的小栈</title><link>https://itart.cn/tags/spring.html</link><description>Recent content in Spring on 艺术码农的小栈</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Tue, 06 Jan 2026 14:54:14 +0800</lastBuildDate><atom:link href="https://itart.cn/tags/spring/index.xml" rel="self" type="application/rss+xml"/><item><title>Spring WebFlux 入门指南（初学者快速上手）</title><link>https://itart.cn/blogs/2026/java/spring/spring-webflux-for-starters.html</link><pubDate>Tue, 06 Jan 2026 14:54:14 +0800</pubDate><guid>https://itart.cn/blogs/2026/java/spring/spring-webflux-for-starters.html</guid><description>&lt;h1 id="1-简介"&gt;1. 简介&lt;/h1&gt;
&lt;p&gt;Spring WebFlux 是 Spring 在 5.x 引入的响应式（Reactive）Web 框架，用于构建&lt;strong&gt;非阻塞、异步&lt;/strong&gt;的网络应用。它基于 Reactive Streams 规范，并与 Project Reactor（&lt;code&gt;Mono&lt;/code&gt;、&lt;code&gt;Flux&lt;/code&gt;）紧密集成。WebFlux 支持运行在 Netty 等非阻塞服务器上，也可以在 Servlet 容器中以非阻塞方式运行。适合高并发、I/O 密集型场景。&lt;/p&gt;</description></item><item><title>Java+mybatis+spring中读取BLOB类型异常</title><link>https://itart.cn/blogs/2015/java/mybatis/java-mybatis-spring-blob-exception.html</link><pubDate>Sun, 01 Nov 2015 19:01:41 +0800</pubDate><guid>https://itart.cn/blogs/2015/java/mybatis/java-mybatis-spring-blob-exception.html</guid><description>&lt;p&gt;在查询包含BLOB字段的对象时可以正常查询出来,但是在调用以下代码时报异常:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;((Blob) attachment.getContent()).getBinaryStream();
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;异常信息:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;java.sql.SQLException: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob&amp;#39;s transaction has been committed or rolled back.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedBlob.checkValidity(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedBlob.getBinaryStream(Unknown Source)
at top.itart.blog.back.service.AttachmentService.createAttachmentFile(AttachmentService.java:61)
at top.itart.blog.back.service.AttachmentService$$FastClassBySpringCGLIB$$13e0b78f.invoke(&amp;lt;generated&amp;gt;)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
at top.itart.blog.back.service.AttachmentService$$EnhancerBySpringCGLIB$$949e7a5e.createAttachmentFile(&amp;lt;generated&amp;gt;)
at top.itart.blog.back.service.AttachmentServiceTest.testSaveImage(AttachmentServiceTest.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:85)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:86)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:241)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: ERROR XJ215: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob&amp;#39;s transaction has been committed or rolled back.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 51 more
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;原因: 读取对象和处理对象的方法分别在两个独立事务中, 当对象读取完事务已经被关闭, 这是在处理BLOB对象时就会报以上错误&lt;/p&gt;</description></item><item><title>spring4 + junit4 事物无法回滚</title><link>https://itart.cn/blogs/2014/java/junit/spring4-junit4-rollback.html</link><pubDate>Fri, 12 Dec 2014 03:41:11 +0800</pubDate><guid>https://itart.cn/blogs/2014/java/junit/spring4-junit4-rollback.html</guid><description>&lt;p&gt;在使用junit 4 测试spring4代码时, 事物始终无法回滚, 即使已经在方法中增加了@Transactiona 和 @Rollback(true)标签, 但是每次执行后数据还是插入到数据库中.
异常代码:&lt;/p&gt;</description></item></channel></rss>