In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
It is believed that many inexperienced people have no idea about how to solve the failure of automatic submission in mysql. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
The problem is simple: JDBC connects to mysl to get connnection and then conn.setAutoCommit (false)
Here's the point. now it's about inserting a record.
Inset1. Then do some logical processing to update another piece of data update2..
Finally, conn.commit (); of course, there is conn.rollback () in catche.
When DEBUG found that insert1 had finished execution, it was already worth it. I thought it was the quarantine level, but I didn't care. And then continue with the logical processing.
An exception conn.reollback () has occurred. At this point, it can be seen that the inserted data is not rolled back. The code check N times did not find a problem.
I have no choice but to ask du Niang, Gu Yeh. This period of time is an ordeal ~ www.2cto.com
In the end, it has yielded results. Found an article about the table storage engine.
Show create table table name
You can see the ENGINE=MyISAM
MyISAM refers to the default storage engine of Mysql. When create creates a new table, Myisam is used by default when the storage engine of the new table is not specified.
MyISAM manages non-transactional tables. It provides high-speed storage and retrieval, as well as full-text search capabilities
Now that there are non-transaction tables, there should be tables that support transactions. Yes, du Niang told me again, InnoDB.
The InnoDB storage engine provides transaction security with commit, rollback, and crash recovery capabilities. But compared to Myisam's storage engine, InnoDB writes are less efficient and take up more disk space to retain data and indexes.
Then change it.
Alter table table name engine=InnoDB
After reading the above, have you mastered how to solve the problem of setting autocommit failure in mysql? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.