1. Exception description
org.springframework.transaction.TransactionSystemException: Could not commit JDBC transaction; nested exception is java.sql.SQLException: Write conflict, txnStartTS=426985930345676879,
After switching the tidb database, the above error reports occur from time to time;
2. Problem analysis
It is found that there is a write conflict by searching the online data according to the error content. The optimistic lock is used by default under version 3.0 of tidb database. This problem will occur in the case of multiple concurrent modifications;
3. Solution
(1) Add & amp; database connection; sessionVariables=tidb_ txn_ Change mode = pessimistic to pessimistic lock
(2) Break big things apart
4. Subsequent optimization selection
Read More:
- The time of the time database displayed by the front end is inconsistent
- Asset database transaction committed tweet appears when unity reports an error!
- When calling time module – time / datetime in wxPython, an error is reported. Valueerror: unknown locale: zh cn
- How to get the current time in java time string
- The problem of [connection lost contact] after C # code connecting Oracle database for a period of time
- Spring failed to commit the transaction
- In SQLite database, set the default value for the field as the current time
- Solve “error: failed to commit transaction” in arch Linux
- The COMMIT TRANSACTION request has no corresponding BEGIN
- Error: current transaction is aborted, commands ignored until end of transaction blockp
- Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communicat
- When xshell 6 is connected normally for the first time, it will prompt could not connect to ‘127.0.0.1’ (port 61708): connection failed
- [Solved] Spark Writer tidb Error: read-uncommitted is not supported
- Android solution to the conflict of calling ontouch and onclick at the same time
- Error (1820) if the password is not changed in time after MySQL installation
- Server (for example: HTTP) has a large number of time_ Solutions to wait
- Set the default time to the current value in MySQL
- It’s time to upgrade your parquet: IOException: totalvaluecount = = 0
- In the XML configuration file of spring jdbc.properties The connection to the database failed due to garbled code
- Encapsulation of adding, deleting and modifying database by JDBC