Problem Description:After starting the transaction, the Java code makes a query, then inserts, which is reported at this time: Java.sql.SQLException:could not retrieve transation read-only status server
resolution process:
View MySQL's things isolation level show VARIABLES like '%iso% ';
return Result: Repeatable-read
Change this to: read-committed: SET GLOBAL tx_isolation= ' read-committed ';
(Remember the Java restart Application, to be permanently effective change My.ini configuration file)
Problem Analysis:
When the database isolation level is repeatable-read, querying 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, in which case the INSERT, UPDATE, The DML statements, such as Delete, will get an error.
Http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_tx_read_only
MySQL Error: Could not retrieve transation read-only status server