Monday, 15 August 2011

ruby - Capture Oracle raise_applicaiton_error in Sequel -


I have a Ruby script that calls a stored procedure in an Oracle DB that has a function that checks whether a table is locked or not. If the table is locked, the process generates a raise_application_error (-20001, ...)

How can I capture raise_application_error in my Ruby script?

To do this I have done this:

  # Prevent unit testing before running all test classes ... Join DB incorrect error = zero ... DB puts defenses to stop the call process! $ Message! Message err = $ !! The message "DB is off. Try again in 5 seconds" sleep (5) try again if err.include? "ORA-20001" and # Unlock Unit Test ... DB  


No comments:

Post a Comment