![]() |
1
4
The biggest problem you'll likely have is that any threads you create won't automatically have a hibernate session attached to them. So if you need to do anything with your domain, you'll need to wire up stuff manually. I looked into it a while ago and it was doable, but I ended up going another way so don't have a finished example to talk about. 我想也有一些插件,比如 Background Thread plugin that will spawn a thread for you and attach the appropriate hibernate stuff. I'm not sure that the plugin is still maintained though so it's possible it won't work on 1.3 or later. 您还可以使用withTransaction在线程中实例化有效的事务。 link text :
Note that each thread would then have it's own transaction and that it wouldn't participate in the same transaction as the other threads (so you wouldn't be able to roll everything back if one thread fails). |
![]() |
2
1
碰巧,我正在复习 second edition of Groovy in Action right now (as in I have the Word document open, and I'm editing it whenever I'm not posting here). That chapter covers concurrency in Groovy in general - it doesn't explicitly mention Grails, but I doubt that that has 许多的 impact on what you might want to use. Chapter 17 is already available in the early access "MEAP" edition...
Anyway, I don't have any direct experience of concurrency in Groovy myself, but it sounds like you should be looking at GPars . |
![]() |
user107586 · 如何处理等待句柄不会导致无限循环? 5 月前 |
![]() |
ron burgundy · 获取-释放语义是否跨线程传递?[副本] 5 月前 |
![]() |
BenjiFB · C#内存缓存:在一次操作中追加到列表? 5 月前 |
![]() |
András Takács · Python多线程问题 9 月前 |
|
András Takács · Python多线程错误 9 月前 |