play1
play1 copied to clipboard
Improved documentation for transaction handling in jobs
Is your feature request related to a problem? Please describe. The current documentation regarding transactions in jobs boils down to "We've got you covered, Don't sweet it." Which is actually not helpful.
Describe the solution you'd like We know, through the documentation, that each request gets its own transaction which is commited to the DB upon response.
Something similarly explicit would be helpful for jobs. For example:
- Does a job started during a request share the same transaction as the request? If so, does the transaction wait for the completion of the job before being closed (even if it runs longer thena the request lasts)?
- Cron Jobs get their own transactions.
- Jobs started from within Jobs get their very own new transaction. The transaction of the parent job gets closed independently upon completion of the parent job.
- Jobs started with afterRequest() get their own transaction.
Additional context I am using Play for years and this is still something I am not sure about. So the above may be wrong. Hence this ticket.