[hibernate-dev] [OGM] OGM and Bean Validation

Emmanuel Bernard emmanuel at hibernate.org
Wed Apr 2 11:40:16 EDT 2014


This would go against the JPA spec unfortunately.

On 02 Apr 2014, at 16:25, Gunnar Morling <gunnar at hibernate.org> wrote:

> Hi,
> 
> Working on a demo for OGM, I tried to apply Bean Validation constraints to
> my entities and have them automatically validated during the persistence
> lifecycle.
> 
> This works as expected (which is very nice), the only thing which made me
> wonder is that the resulting ConstraintViolationException is wrapped into a
> RollbackException. Basically that's not surprising as we use TX demarcation
> to control the flush cycle also if the store is actually non-transactional,
> yet it may cause irritations and false expectations by users.
> 
> So I'm wondering whether we rather should raise a more generic
> PersistenceException (or another specialized type which doesn't indicate a
> rollback may happen) when using a non-transactional backend? What do you
> think?
> 
> --Gunnar
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev



More information about the hibernate-dev mailing list