I have a .net application that has to execute a series of steps in a job. Each step lives in its own transaction, and all tasks are executed serially (no explicit async). The last two tasks are a data transform, and a data retrieval of the transformed data. We are getting deadlock errors from these last two steps, because the last step looks like it's trying to get at data that the previous step still has locked.
Is it possible that sql will report that execution is finished, before it actually is? Could a lock persist across a completed transaction? Is there anything else I should look for to understand what is happening?
By serial I mean one after another. Each transaction is completed before the next one starts. If any failures occur, that transaction is rolled back and the entire process halted to allow for a user retry.