摘要: 通过TransactionCallback接口中的方法后(这里用来做业务),将返回值传递到TransactionTemplate的execute()中。通过调用TransactionStatus 的setRollbackOnly()方法来实现事物回滚。 如果不需要返回值,则需要做以下操作(由于Tra 阅读全文
posted @ 2018-12-20 15:29 沟渠映明月 阅读(10929) 评论(0) 推荐(0) 编辑
摘要: 允许子类继承父类的注解 https://blog.csdn.net/renli2549/article/details/78432272 阅读全文
posted @ 2018-12-20 11:37 沟渠映明月 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 先查询某字段重复的全部数据 select count(param) as count from table group by param having count > 1 (多个字段判断重复数据) select count(param) as count1, count(param2) count2 阅读全文
posted @ 2018-11-27 15:42 沟渠映明月 阅读(144) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/fashflying/p/6908028.html https://blog.csdn.net/u010588262/article/details/81003493 阅读全文
posted @ 2018-11-27 11:14 沟渠映明月 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 今天发现个自己的bug,仔细排查后,发现根本原因我在service方法中抛出的异常被控制层的方法捕获了,所以后台页面也只是出现个错误提示,而数据却没有回滚。 解决方式:对自己抛出的异常使用try catch,catch中 使用 阅读全文
posted @ 2018-11-22 11:17 沟渠映明月 阅读(163) 评论(0) 推荐(0) 编辑
摘要: URL url = new URL("www.baidu.com");改为 URL url = new URL("http://www.baidu.com"); 阅读全文
posted @ 2018-11-20 16:46 沟渠映明月 阅读(988) 评论(0) 推荐(0) 编辑
摘要: 今天学py的map函数时,由于在上面定义了一个dict类型的变量(取的名是map),所以编译后报了这么一个错,哎,以后学py命名要小心了 阅读全文
posted @ 2018-11-15 14:59 沟渠映明月 阅读(3399) 评论(0) 推荐(0) 编辑
摘要: 解决方案: 启动类上加@EnableAutoConfiguration(exclude = { FreeMarkerAutoConfiguration.class }) 或者在配置文件添加spring.freemarker.check-template-location=false 阅读全文
posted @ 2018-11-06 16:16 沟渠映明月 阅读(2121) 评论(0) 推荐(0) 编辑
摘要: 启动项目自动结束,查看日志发现 [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance 阅读全文
posted @ 2018-11-06 16:16 沟渠映明月 阅读(2097) 评论(0) 推荐(0) 编辑
摘要: springboot从1.5.9升级到2.0.0,queueingconsumer报错没有这个类,改为使用 DefaultConsumer 阅读全文
posted @ 2018-11-06 16:15 沟渠映明月 阅读(1229) 评论(0) 推荐(0) 编辑