Warn [org. hibernate. util. jdbcexceptionreporter]-<SQL error: 0, sqlstate: s1009>
Error [org. hibernate. util. jdbcexceptionreporter]-<connection is read-only. Queries leading to datamodification are not allowed>
Org. hibernate. Exception. genericjdbcexception: cocould not executeupdate Query
Cause:
If this error is reported, it is estimated that it is a problem with the transaction configuration file in SSH.
<! -- Configure the propagation feature of transactions -->
<TX: Advice id = "txadvice" transaction-Manager = "transactionmanager">
<TX: Attributes>
<TX: methodname = "add *" propagation = "required"/>
<TX: methodname = "delete *" propagation = "required"/>
<TX: methodname = "Modify *" propagation = "required"/>
<TX: methodname = "*" Read-Only = "true"/>
</TX: Attributes>
</TX: Advice> it specifies that the database operation function must start with the above string. Otherwise, the database access permission is read-only according to the default configuration.
Generally, a database operation class xxservice inherits the basic class Dao.
The methods in database operation class xxservice are compared with those in the transaction configuration table during execution and assigned the corresponding permissions.
Solution:
There are two solutions
1. standardized naming
2. Delete read-only = "true", but this method is not recommended because it may cause unexpected problems or affect the server performance.