OBGM-584 Fix issue with missing session while executing jobs#4160
OBGM-584 Fix issue with missing session while executing jobs#4160awalkowiak merged 3 commits intofeature/upgrade-to-grails-3.3.10from
Conversation
kchelstowski
left a comment
There was a problem hiding this comment.
Just a few questions out of curiosity, to get to know the flow. But overall good job @awalkowiak, it was not an easy task!
grails-app/jobs/org/pih/warehouse/jobs/AssignIdentifierJob.groovy
Outdated
Show resolved
Hide resolved
|
@kchelstowski @jmiranda I added the missing |
jmiranda
left a comment
There was a problem hiding this comment.
This looks fine to me. However, I will say that I would prefer the sessionRequired property to be explicitly added to each job (similar to concurrent property) because it's just a property and there's no functionality associated with it. This would also provide a less opaque solution and would let us control the sessionRequired property for each job in the rare case we needed to deal allow sessions for some of the jobs.
The parent class would have been if we needed to do something like this. But just adding a property seems like overkill.
void execute() {
doSomethingBefore()
execute()
doSomethingAfter()
}
With that said, it seems like a fine solution.
plus wrap executes content with .withNewSession when there is a transaction and a gorm save
|
@jmiranda I moved the |
No description provided.