This query should be performed as part of the transaction, not outside it.