[infinispan-dev] Event handling behaviour

Mircea Markus mmarkus at redhat.com
Thu Oct 17 11:18:20 EDT 2013


On Oct 17, 2013, at 4:09 PM, Mircea Markus <mmarkus at redhat.com> wrote:

> 
> On Oct 17, 2013, at 2:10 PM, Sanne Grinovero <sanne at infinispan.org> wrote:
> 
>> For example a strong use case for these events is data validation: I'm
>> looking forward for an integration with Bean Validation, and when that
>> happens I'm pretty sure we'll want to rollback the transaction in case
>> of validation failures.
> 
> Makes sense. This won't work for async listeners, nor allowing the listener direct access to javax.transaction.Transaction object. Perhpas an Event.abortTransaction() would do the trick.

https://issues.jboss.org/browse/ISPN-3642

> 
>> 
>> BTW I still don't like the need to invoke "isPre()". IMO you should
>> provide a way to register the Listener to happen only after or before;
>> the isPre method can stay where it is for convenience but it bothers
>> me that you have to call it on each invocation, it should be optional,
>> for example for those cases in which I need two different operations
>> to happen before/after and I'm too lazy to code two different
>> listener.
> 
> 
> +1. Making it an attribute to the @Listener annotation would do just that.

https://issues.jboss.org/browse/ISPN-3643

Cheers,
-- 
Mircea Markus
Infinispan lead (www.infinispan.org)







More information about the infinispan-dev mailing list