Making Grails in Quartz

Good afternoon guys.

I have a question about transactions until spring and Grails come up when I have multiple jobs with the same service.

I have a service with a default setting in Grails and a method that runs every 5 seconds. according to the quartz task, but the method takes more than 5 seconds to complete. to be finished. My question is, when do the quartz calling this method execute in one transaction or is a new one created every time this happens? I know that every call to quartz creates a new thread, but does not know if they are in the same transaction, and, for example, if the call throws an exception to roll back everything that has been done so far.

I appreciate the answers.

+4
source share
1 answer

Transaction status is stored in ThreadLocals, so two simultaneous calls to transactional services on different threads will have their own transactions.

+2
source

Source: https://habr.com/ru/post/1534672/


All Articles