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 13:11:13 GMT
2016-11-09 14:09 GMT+01:00 Darjan Oblak <darjan@gmail.com>:

> The attachments do not work obviously.
>
> Tomee 1.7: http://i.imgur.com/nD1PTVf.png
> Tomee 7: http://i.imgur.com/oPq1ctK.png
>
> Regarding the hibernate-validator issue - I added the javax.el-api to
> pom.xml as hibernate-validator demands specifies it as provided dependency
> (tomee7 doesn't provide it yet as it seems:
> https://issues.apache.org/jira/browse/TOMEE-1306).
>
>
Remove it, tomcat does. These "Ensure XXX" jira tickets are TCK related
(just ignore them).


> Hibernate validator got loaded then, but crashed as EL had no
> imlementation. Added the one from glassfish and I got: INFO: Using
> org.hibernate.validator.HibernateValidator as validation provider. But the
> performance issue remained, profiler still shows bval being used as
> validator.
>
>
Makes sense if you put the API in the webapp (not needed).


> However, updating bval to 1.1.2 seems to fix the whole issue. It is a major
> performance boost for the same test (~30 seconds tomee 1.7, ~40 seconds
> tomee 7, ~10 seconds tomee 7 with bval 1.1.2). Our integration tests now
> run 9 minutes instead of 13 min.
>
> Thank you!
>
> On Wed, Nov 9, 2016 at 12:23 PM, Romain Manni-Bucau <rmannibucau@gmail.com
> >
> wrote:
>
> > 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