Database - Regarding the configuration of JAVA spring transactions, is this correct?
高洛峰
高洛峰 2017-06-12 09:25:50
0
3
648


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...

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all (3)
为情所困

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

    代言

    Write on the specific implementation method of dao.

      洪涛

      Annotate on the business layer that the controller is a singleton by default. Under normal circumstances, just use the default thing

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!