java - Get an Exception from CDI transactional observer methods -


we can declare observer method transactional defining transactionphase attribute like:

public void ondocumentupdate(@observes(during=after_success) @updated document doc) {     ... } 

is possible exception causes transaction broken within transactional cdi observers? example, i'd write business logic scenario based on exception thrown:

void ondocumentupdate(@observes(during=after_failure) @updated document doc) {     exception e = getfailurecause();     if (check_wether_e_is_instance_of_constraintviolationexception) {         //     } } 

any ideas how achieve it? in advance!

consider using cdi interceptors handle exceptions.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -