1 Star 1 Fork 0

hongsam/sshdemo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
issue_list.txt 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
hongsam 提交于 2016-03-09 01:59 +08:00 . 添加placeholder issue及其解决方法
Issue 1
org.springframework.dao.InvalidDataAccessApiUsageException: 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.invoked hibernate template done...
解决方法:
web.xml中配置OpenSessionInViewFilter初始参数:singleSession:true、flushMode:AUTO
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
在Spring配置文件中,将方法的read-only设置为false
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" read-only="false" propagation="NOT_SUPPORTED" />
<tx:method name="reg*" read-only="false" propagation="NOT_SUPPORTED" />
<tx:method name="find*" read-only="false" propagation="NOT_SUPPORTED" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
-------------------
--
--ISSUE 2
------------------------------
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'activity_template_id' in string value "${activity_template_id}"
解决方法:
<!-- 让 spring 去读取指定路径下的资源文件 -->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations" value="classpath*:config/jdbc.properties" />
</bean>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/hongsam/sshdemo.git
[email protected]:hongsam/sshdemo.git
hongsam
sshdemo
sshdemo
master

搜索帮助