ssh整合后运行时常见的bug
Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
这是什么原因造成的呢?
这是因为ssh三个框架整合后,dao层主要用HibernateTemplate的方法对数据库进行操作导致的,这样必须得添加事务才能不出错。
具体的解决方法如下,我们可以在applicationContext.xml中开启一些事物
<!--配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 开启事务扫描,采用注解方式 -->
<tx:annotation-driven transaction-manager="transactionManager"/>
在我们的方法上加如下注解即可
@Transactional
分享到:
相关推荐
使用Spring提供的Open Session In View而引起Write operations are not allowed in read-only mode (FlushMode.NEVER) 错误解决
2015-01-16: Version 8.039.01: Changed driver code to not use IP checksum hardware offload (caused various issues with networking in VMs) 2015-01-05: Version 8.039.00: Original version
xml/ns/javaee":deferred-syntax-allowed-as-literal, "http://java.sun.com/xml/ns/javaee":trim-directive-whitespaces, "http://java.sun.com/xml/ns/javaee":default-content-type, ...
NOTE: Windows executables in SDK are not signed so you may encounter security warnings on W8 and W10. On MacOS you may need to run SDK executables directly from console as they are not signed too.
Prerequisites: Java VM 1.8 Open a command shell/window, browse to where you ...Using the --help option will show the allowed command line arguments. 更多查看: https://github.com/WebGoat/WebGoat
When True then in ftmPanning mode will be shown only cached image of the initial client area. All parts outside will paints of the TFlexPanel.Brush. When returning from ftmPanning mode the complete ...
NOTE: sciter.dlls, sciter.exe and notes.exe Windows executables in SDK are digitally signed now. On MacOS you may need to run SDK executables directly from console as they are not signed too.
在线封装和离线封装驱动 ... Description ...Adds the blacklisted ESXi 5.1 built-in ...Requires MaintMode Live Install Allowed Live Remove Allowed Stateless Ready Overlay Yes No No Yes No
Requires MaintMode Live Install Allowed Live Remove Allowed Stateless Ready Overlay Yes No No Yes No Additional links VMware Communities thread about running VMware ESXi inside Hyper-V Build ...
Requires MaintMode Live Install Allowed Live Remove Allowed Stateless Ready Overlay Yes No No Yes No Additional links Related VMware Forum's post Package updated to include missing device IDs 1502...
- Access to any object inside your application (in case you've allowed this). Standard libraries to access to base classes, controls and forms. Easily expandable library architecture. - Debugger....
java.sql.SQLException: null, message from server: “Host ‘223.72.41.7’ is not allowed to connect to this MySQL server” 客户端访问时报错: 解决方法: 1,登陆服务器 mysql> use mysql; //用mysql ...
Vue Element Sortablejs实现表格列的拖拽案例详解 1. css: dragTable.css @charset "UTF-8"; .w-table{ height: 100%; width: 100%;... } .w-table_moving .el-table__fixed{ cursor: not-allowed;
directories that will not be allowed to be processed by Diskeeper. Event Logging ------------- Diskeeper records information about its activity in two ways. First, general information about ...
解决fatal:remote error:You can’t push to git://github.com/username/*.git问题的办法 今天Git push的时候 fatal:remote error: You can't push to git://github....看来我是没有权限push啊。 解决方法: ...接
Use the post template feature -located in campaign settings-. For example: {content} <p><a >Link to the original site</a></p> = Why isn’t the full article showing? = Because the feed you're using ...
In fact, you are allowed to surround your access expression with ${...} if it makes you feel more comfortable: <div sec:authorize="${hasRole(#vars.expectedRole)}"> This will only be displayed if ...
开源项目-pawelad-just-scored.zip,为世界杯球迷提供lambda动力的Slack应用程序
解决:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after statement closed.
log-in login .must-log-in :用户必须登录才能发表评论.reply :包装器<div> .comment-reply-link :回复链接.comment-reply-login :用户必须登录才能发表评论.comment-notes #email-notes .form-allowed-tags :...