Why open a transaction if you're not changing anything though? Is that what causes possible "empty transactions", which you then need to check for?

Re: wrapping function, not necessarily, you could do either:

```
execute = transactional(function() {
  // do stuff
});
```

or

```
execute = function() {
  if (cond) {
    transactional(function() {
      // do stuff
    })();
  } else {
    // call other
  }
});
```

The latter could also be syntactic sugared into another helper, e.g.:

```
execute = function() {
  if (cond) {
    transaction(function() {
      // do stuff
    });
  } else {
    // call other
  }
});
```