用hibernate技术,对商品进行更新时,出现下面的错误:
java.lang.UnsupportedOperationException: Can't write to a readonly object......
上面的意思是:不能对可读文件进行写的操作。结果找到我对应的goods.hbm.xml文件,看了一下,文件头部我设置了二级缓存,hibernate无法对设置了只读缓存的表进行修改
“<cache usage="read-only"/>” .
因此:这个缓存对我来说是没有用的了,我直接把它删除,Ok,问题解决。
还可以把“<cache usage="read-only"/>”改为可以读写的“<cache usage="read-write"/>” 。就可以执行修改操作了
Ok,再运行,程序正常.
相关文章
- cv2.SIFT() AttributeError: 'module' object has no attribute 'SIFT' OpenCV Python can't use SURF, SIFT
- 问题分享:ActiveX component can't create object: "MSComDlg.CommonDialog"
- redis.clients.jedis.exceptions.JedisDataException :READONLY You can't write
- [求助]使用VB自带程序制作安装程序时,遇到429错误:ActiveX component can't create object
- Can't create/write to file 'C:\WINDOWS\TEMP\...MYSQL报错解决方法
- codis扩容报错:[error] READONLY You can't write against a read only slave
- Windows10 MySQL5.7.21.0 mysqldump: Got error: 1: Can't create/write to file 'C:\person.txt'... 解决办法
- [转]PHP使用empty检查函数返回结果时报Fatal error: Can't use function return value in write context的问题
- ERROR 1 (HY000): Can't create/write to file '/tmp/#sql_830_0.MYI' (Errcode: 13)
- MySQL into outfile 问题解决:ERROR 1 (HY000): Can't create/write to file