The biggest problem that you are likely to encounter is that the threads you create will not automatically establish a hibernation session. Therefore, if you need to do something with your domain, you will need to manually connect the material. I looked at it a while ago, and that was doable, but I ended up going the other way, so I don't have a ready-made example to talk about it.
I think that there were several more plugins, for example the Background Thread plugin , which will spawn a thread for you and join the corresponding sleep mode. I'm not sure if the plugin is still supported, although it is possible that it will not work in version 1.3 or later.
, withTransaction :
MyDomain.withTransaction { status ->
}
, , ( , ).