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

android - Pass an Serializable object in AIDL -

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

How to use Authorization & Authentication in Asp.net, C#? -