Environment: mysql+java+hibernate
Problem Description: after starting the transaction, the Java code First makes a query, then inserts, and then it reports: ERROR jdbcexceptionreporter:78-could not retrieve transation read-only status s Erver
Problem Solving process: View MySQL's things isolation level
SHOW VARIABLES like '%iso% ';
Results returned: repeatable-read
Change this to: read-committed: SET GLOBAL tx_isolation= ' read-committed '; (Remember Java restart app)
To be permanently effective, change the my.cnf.
Analysis: When the database isolation level is repeatable-read, publishing a SELECT statement is also the beginning of things, and in hibernate the transaction starting with the SELECT statement is marked as a read-only transaction. At this point, the execution of the INSERT, UPDATE, DELETE and other DML statements will be error.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
FIX: ERROR jdbcexceptionreporter:78-could not retrieve transation read-only status server