As per your requirement,
will the transaction begin, only after end of the previous transaction? or when one transaction goes on, another transaction can be started? If it is, then you have to handle differently, your solution may not work, else this is fine.