Suppose we have a DAL method
public void BuyProduct(int productId, int quantity, int buyerId);
Within that method we need to call 2 stored procedures:
- EXEC tblOrders_CreateNewOrder
- EXEC tblProducts_RecalculateStock
Is it a good practice to create 2 SqlCommands - one per stored procedure and to use a single SqlConnection to execute those commands?
OR
Is it better to create a separate SqlConnection for each SqlCommand?
So basically I am asking: is it a good practice to reuse a single SqlConnection for multiple (2-4) SqlCommands within a single DAL method (obviously reusing SqlConnection across the entire DAL would be dumb)?
PS - please do not ask me why can't I just combine the 2 stored procedures into 1. My answer is - separation of concerns.