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

Gunnar Morling gunnar at hibernate.org
Wed Apr 2 18:00:56 EDT 2014


Hum, I guess it's one of the cases then where JPA doesn't 100% match for
the purposes of talking to NoSQL.


2014-04-02 17:40 GMT+02:00 Emmanuel Bernard <emmanuel at hibernate.org>:

> 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
>
> _______________________________________________
> 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