I
I
Igor Grishin2017-06-13 10:05:47
PostgreSQL
Igor Grishin, 2017-06-13 10:05:47

Will the transaction end with update if there is an error in the called procedure?

There is a table equipment_status. A trigger has been created for it:

CREATE TRIGGER "trg_eq_statuses_techtracker"
AFTER UPDATE ON public.equipment_status FOR EACH ROW
EXECUTE PROCEDURE trg_eq_statuses_techtracker()

which, after updating the table, calls a function trg_eq_statuses_techtracker()that calls a procedure eq_statuses_techtracker()that may fail (trying to put a message into RabbitMQ).
In java, this table is being updated. Since java wraps all requests in transactions, what happens if eq_statuses_techtracker()an error occurs in? Will the transaction be rolled back?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
terrier, 2017-06-13
@terrier

calls the eq_statuses_techtracker() procedure, which may fail

"Complete with an error" in the sense of throwing an exception? Then this will rollback the entire transaction (if no one catches this exception)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question