This post has NOT been accepted by the mailing list yet.
Im using Grails' new async/promises api which is built upon Gpars as far as I know. So my question really relates to gpars I think..
Im using the new async api to parallelize some file processing/db updating.
I launch several promises which each read files, parse and then update the db. This is all sone inside a @transactional Service method.
My problem though is rolling back the work of all the promises if one of them goes wrong and throws a runtimeexception. Only the one that cause the exception does a rollback, all the others commit their work (which i dont want)
I tried promise.onError also but no luck.
Is it even possible to achieve what I am trying ? I think a new hibernate session is created for each promise if im not mistaken which would mean I cant do what Im trying to do - I think
In terms of db operations is gpars really only suitable for reads rather than writes ?