Since you need more programatic and fine grained control of your transactions within that service I would recommend you look at using withTransaction instead. This way you can execute each file within it's own transaction instead of a single transaction as a service method.
In theory your code would look something like this:
class DocumentoTrasportoService extends GenericService {
public void processFiles(String path){
def pathFile = new File(path)
pathFile.eachFile{
MyDomainClass.withTransaction { status ->
try {
processFile(it)
//move file to folder "backup"
} catch (Exception ex){
//I want to rollback here
status.setRollbackOnly()
//move file to folder "errors"
}
} // end of transaction
}
}
public void processFile(File file){
//read file
//do validations
//insert domains
}
Notice that you only need to set the status for rolling back the transaction. Hope this helps.