# Hibernate validation with Spring data rest repository

**URL:** <https://discourse.hibernate.org/t/hibernate-validation-with-spring-data-rest-repository/1452>\
**Category:** Hibernate Validator\
**Created:** [September 26, 2018, 6:43am UTC](https://discourse.hibernate.org/t/hibernate-validation-with-spring-data-rest-repository/1452 "2018-09-26T06:43:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![biplab](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@biplab](https://discourse.hibernate.org/u/biplab)\
**Post date:** [September 26, 2018, 6:43am UTC](https://discourse.hibernate.org/t/hibernate-validation-with-spring-data-rest-repository/1452/1 "2018-09-26T06:43:06Z")

</div>

I am trying to perform some operation in Spring data events **HandleBeforeCreate** / **HandleBeforeSave**. Looks like with Spring data rest repository, hibernate validation (validation added with annotations like **NotBlank** ) happens after executing methods which are annotated with **HandleBeforeCreate** / **HandleBeforeSave** and if validations fail, it rollbacks the original transaction.  
My question is why the validations happen before committing, shouldn’t it happen before even executing the save() method?
