Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Transaction (Process ID 52) was deadlocked on lock resources with
- another process and has been chosen as the deadlock victim.
- Rerun the transaction.
- Transaction A
- RETRY: -- Label RETRY
- BEGIN TRANSACTION
- BEGIN TRY
- truncate table tablename
- WAITFOR DELAY '00:00:05' -- Wait for 5 ms
- Insert into tablename
- COMMIT TRANSACTION
- END TRY
- BEGIN CATCH
- PRINT 'Rollback Transaction'
- ROLLBACK TRANSACTION
- IF ERROR_NUMBER() = 1205 -- Deadlock Error Number
- BEGIN
- WAITFOR DELAY '00:00:00.05' -- Wait for 5 ms
- GOTO RETRY -- Go to Label RETRY
- END
- END CATCH
- **Read from MS SQL SERVER >> write into hdfs >> load into greenplum**
- truncate table tablename
- select pg_sleep(5) -- Wait for 5 ms
- Insert into tablename
- RAISE INFO 'Rollback Transaction'
- IF ERROR_NUMBER = 1205 -- Deadlock Error Number
- THEN
- select pg_sleep(5) -- Wait for 5 ms
- -- Go to Label RETRY
- END
Add Comment
Please, Sign In to add comment