if you are writing your own wrapper class, you can wrap begin_work and the other transaction methods so you can maintain your own state.
You're depending on undocumented features or assumptions that may change, especially if you have to switch to another driver.