Hello everybody,
Our team had decided to use transactions in a stored procedure. The master stored procedure calls several procedures to refresh the reporting tables. The transaction was added to ensure that the reporting tables refresh would be committed to the DB only when all the procedures execution is complete. However when we add the transaction block, and execute the SQL procedure It does not allow anybody else to access the list of tables from the Management studio editor on that DB. Some of the tables return results when queried but some of them give timeout messages
the specific error msg that we get is "Error: 1222 Lock request time period exceeded"
the code for sp is something like this
CREATE PROC RefreshTables AS BEGIN TRANSACTION UpdateReportingTables BEGIN TRY Exec dbo.UpdateRT1 Exec dbo.UpdateRT2 Exec dbo.UpdateRT3 Exec dbo.UpdateRT4 COMMIT UpdateReportingTables END TRY BEGIN CATCH ROLLBACK UpdateReportingTables END
I can neither see the list of tables in the editor when i expand the tables [in the right menu], nor query the tables when the
RefreshTables
proc is being executed. Any advise or suggestions on what i might be doing incorrectly?
Regards, Dinesh