zloster / FrameworkBenchmarks

Source code for the framework benchmarking project
http://www.techempower.com/benchmarks/
Other
0 stars 0 forks source link

Dropwizard/Hibernate/MySQL combo not updating state in the DB? #51

Closed zloster closed 6 years ago

zloster commented 6 years ago

[From the mailing list}(https://groups.google.com/d/msg/framework-benchmarks/7KzlbOfnm30/KODCEcxIBAAJ):

I am experiencing database deadlock issue with Updates test of ActFramework, and when I tried to debug some other framework to see if I can get some clue, I found at least Dropwizard and ninjar-standalone tests did not commit the changes into the database, i.e. the World table not changed after sending request to updates test endpoints. I found this issue by setting a breakpoint into the relevant code of updates test, and checking the world record been updated from MySql workbench, after the response sent back, I check the same world record again in the MySql workbench and found the data is not updated. I specifically checked Act and minijax framework using the same technique and found the record did change after response sent back.

I've done a quick check and indeed the value in the returned JSON for given id is different than in the DB.

zloster commented 6 years ago

The strange thing was when using the status command in the mysql shell each single update was issuing 4 (four) SQL statements. At least the counter was telling such a number. This needs inspection. Also investigate tweaking the Hibernate CacheMode, FlushMode and adding readonly attribute for the read-only operations:

zloster commented 6 years ago

The implementation is changed to use batch updates with manual hibernate transaction handling. Creating bug reports to dropwizard and hibernate is pending.