tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Tomee 7 validation provider configuration and performance issues
Date Wed, 09 Nov 2016 11:23:40 GMT
before commenting inline, seems Gmail doesn't like your pictures not sure
why (and not sure it is important yet)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-11-09 12:15 GMT+01:00 Darjan Oblak <darjan@gmail.com>:

> Hi,
>
> recently we migrated our app from tomee 1.7 to tomee 7.0.1. Surprisingly
> execution time of hundreds of integration tests became 30 % longer.
> Investigation with a profiler revealed the org.apache.bval seems to be the
> bottleneck.
>
> Obviously we even had the application misconfigured even in tomee 1.7
> where bval is used used instead of hibernate validator provided through
> pom.xml. The same remains with tomee 7.
>
> I have two questions:
>
> 1. How exactly can I configure tomee 7 to use hibernate validator instead
> of apache bval. I tried including META-INF/validation.xml and specifying
> <default-provider>org.hibernate.validator.HibernateValidator</default-provider>,
but
> got: org.apache.openejb.assembler.classic.ValidatorBuilder getConfig
> WARNING: Unable create  validator factory with provider
> org.hibernate.validator.HibernateValidator (Unable to find provider:
> class org.hibernate.validator.HibernateValidator). Default one will be
> used.
>
>
This is weird since the loading should use the application classloader. Do
you care testing against 7.0.2 (snapshot or not) just to ensure it is still
the case please?


> 2. Are you aware of any performance issues with the bval version provided
> by tomee 7? Isn't validator supposed to cache annotations somehow, not
> inspecting them over and over again?
>
>
Yes if you configure anything on the validator and don't reuse the instance
then you can have some issues (primefaces fixed this misusage for instance)

Note this is fixed on bval 1.1.2 which is coming with tomee 7.0.2 and this
issue will only affect the usage of a parameternameprovider and no more a
constraint factory or message resolver.


> Here are two profiler screenshots for a dummy test of app startup together
> with a test doing 100k persist operations of a simple object with even no
> validation used. I know hibernate is not meant to be used in such way for
> batch inserts, I used it just as a proof of concept. The jdbc operations
> are identical for both versions, just bval processing differs (in tomee7
> being ~2.5x slower for the example provided).
>
> tomee 1.7:
>
> [image: Inline image 1]
>
> tomee 7:
> [image: Inline image 2]
>
> Thank you
>
> Best Regards,
> Darjan Oblak
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message