Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Hibernate Validator - Field-level constraint performance
PostPosted: Wed Dec 16, 2015 2:18 pm 
Newbie

Joined: Wed Dec 16, 2015 1:27 pm
Posts: 1
I'm on a project team that is using Hibernate Validator to validate all Strings in Entity fields as we pull data from our database.
We use Hibernate Validator 5.1.3, EclipseLink 2.5.2 and JPA 2.0.

There is a significant slow down when performing field level validation on a collection of entities with multiple field constraints.
On one test we are retrieving ~72,000 entities from the database, each with 8 constraints.
To validate all 72,000 entities, it takes 47 seconds, while without validation the test only takes 3 seconds to retrieve data from the database.
We've tested using only our custom constraints and using only built-in constraints (@NotNull), both show the same performance issue.
Some debugging shows that 46.5 seconds is spent after calling Validator.validate() and before reaching isValid().

However, when I set the annotation at class-level, and manually performing the required reflection and string validation on the entity inside isValid(), it only takes ~0.5 to complete validation for all 72,000 entities.

I would think Hibernate could naively handle this magnitude of field-level validation.
I didn't see any performance issues reported for Hibernate Validator 5.1.3.
Any suggestions?

Cheers,
Andre


Top
 Profile  
 
 Post subject: Re: Hibernate Validator - Field-level constraint performance
PostPosted: Wed Dec 16, 2015 3:22 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1530
I think you should open an issue on JIRA for this and detail the exact context. Thanks.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
 Post subject: Re: Hibernate Validator - Field-level constraint performance
PostPosted: Mon Dec 21, 2015 12:20 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Thanks for the issue.

for reference to other readers, it's: https://hibernate.atlassian.net/browse/HV-1040

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.