Ensure that exception is thrown if unit of work is inactive.

Change-Id: I6dd30dc46a2f5fde98e912a26595906f4c7e0fe5