Configure this in the spring configuration file and then
Is it ok to annotate this @Transactional in the method?
Which layer should I annotate at? Is it the control layer, service layer or dao layer? Or both are ok
? ? ? Why are you stepping on my question...
为情所困2017-06-12 09:27:50
Theoretically, it should be written in service, because the dao layer is only for data persistence. Sometimes the business involves inserting data and uploading it, or deleting data and deleting files at the same time. This kind of business is usually implemented in service. Therefore, it is recommended that you put the service layer and do not use transactions if you want to check data
PHP中文网2017-06-12 09:27:50
Annotate on the business layer that the controller is a singleton by default. Under normal circumstances, just use the default thing