Home > Back-end > Questions about serviceimpl execution caton, fairy the way, have a few days
Questions about serviceimpl execution caton, fairy the way, have a few days
Time:09-24
Everybody is good, recently had an HTTP service, pass through json receiving service data, Because application scenario is very simple, direct use the ready-made DWZ framework, for springmvc + mybatis, Also use this architecture before, feel, still can be found nothing problem, But strange problems in using this, my first words description: Don't know under what circumstances, the controller invokes the service implementation to perform persistence operations, will be caton, Caton is used to describe don't know whether reasonable, also can hang on, or what, in short, through the HTTP request to the controller and then call the service implementation for database query, not immediately implement the service implementation class methods, I found, the debug system. The first line even if in the implementation class out. Print (1); Won't be executed immediately, but in a few seconds, and even a few seconds, a minute will continue to execute and return to normal, the contents of the two at the time of caton spooled asked below
After the restart the service, no matter how to invoke any controller of any service query any table, all no problem, but don't know what circumstance in use after the restart, will enter a state of caton, and once you start caton, every request will be caton,
Don't know what reason is caused, related to the environment? Things about? Database, etc.? Please tell the great god, thank you very much ~!
CodePudding user response:
In addition, once the state of the problem, if I had the same HTTP request three times, then can output three times above the bottom two lines of log, and after waiting time, three service implementation class is performed at the same time; If my this request is to insert a user, the service in the library query table to verify the user name may not be repeated, but the above situation, three of the same user will after caton insert success at the same time, and without any proof, that is to say, three records of the insert is simultaneously
CodePudding user response:
All the work? Friday is not tie to hi, don't only I in overtime, calling upon the villagers
CodePudding user response:
Continue to call, this problem does not solve sleep
CodePudding user response:
In front of a selectProvince method for transaction isolation level is required will block the current thread