[
https://issues.apache.org/jira/browse/GERONIMO-6393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13467143#comment-13467143
]
Jarek Gawor commented on GERONIMO-6393:
---------------------------------------
In revision 1392563 I committed the change so that the Validator lookup code
reuses the same ValidatorContext for the same application.
> javax.validation.Validator lookup improvement
> ---------------------------------------------
>
> Key: GERONIMO-6393
> URL: https://issues.apache.org/jira/browse/GERONIMO-6393
> Project: Geronimo
> Issue Type: Improvement
> Security Level: public(Regular issues)
> Components: general
> Affects Versions: 3.0
> Reporter: Jarek Gawor
> Assignee: Jarek Gawor
>
> Each time the same application looks up javax.validation.Validator object in
> JNDI a completely new instance of the object is returned (as required per
> spec). However, with Apache Bean Validation implementation that means that
> expensive annotation scanning is done on each Validator.validate() call.
> Apache Bean Validation implementation maintains an annotation cache with each
> ValidatorContext. However, each ValidatorFactory.getValidator() call creates
> a new instance of ValidatorContext and that's why the cache is not reused and
> annotation scanning is done on each call. In Geronimo we can ensure that the
> same ValidatorContext is used for the given application and therefore, ensure
> that cache is reused and annotation scanning is only done one.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira