Guest User

Untitled

a guest
Oct 20th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. Transaction (Process ID 52) was deadlocked on lock resources with
  2. another process and has been chosen as the deadlock victim.
  3. Rerun the transaction.
  4.  
  5. Transaction A
  6.  
  7.  
  8. RETRY: -- Label RETRY
  9. BEGIN TRANSACTION
  10. BEGIN TRY
  11.  
  12. truncate table tablename
  13. WAITFOR DELAY '00:00:05' -- Wait for 5 ms
  14. Insert into tablename
  15.  
  16. COMMIT TRANSACTION
  17. END TRY
  18. BEGIN CATCH
  19. PRINT 'Rollback Transaction'
  20. ROLLBACK TRANSACTION
  21. IF ERROR_NUMBER() = 1205 -- Deadlock Error Number
  22. BEGIN
  23. WAITFOR DELAY '00:00:00.05' -- Wait for 5 ms
  24. GOTO RETRY -- Go to Label RETRY
  25. END
  26. END CATCH
  27.  
  28. **Read from MS SQL SERVER >> write into hdfs >> load into greenplum**
  29.  
  30. truncate table tablename
  31. select pg_sleep(5) -- Wait for 5 ms
  32. Insert into tablename
  33.  
  34. RAISE INFO 'Rollback Transaction'
  35.  
  36. IF ERROR_NUMBER = 1205 -- Deadlock Error Number
  37. THEN
  38. select pg_sleep(5) -- Wait for 5 ms
  39. -- Go to Label RETRY
  40. END
Add Comment
Please, Sign In to add comment