[hibernate-issues] [Hibernate-JIRA] Commented: (HV-460) Create a SerializableValidatorFactory wrapper that has enough information to either access or create a matching implementation when deserializing

Hardy Ferentschik (JIRA) noreply at atlassian.com
Tue Oct 25 05:39:20 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44157#comment-44157 ] 

Hardy Ferentschik commented on HV-460:
--------------------------------------

{quote}
Our current workaround is to share the same Validator Factory instance but a user just reported a problem with that (http://community.jboss.org/thread/174014).
{quote}
Right, there is a problem. _ValidatorFactoryImpl_ uses a _BeanMetaDataManager_ which in turn uses _BeanMetaDataCache_. The cache caches the Bean Validation metadata per class to speed up validation. Depending on how exactly the class loading works regarding re-deploys this will cause a problem. 

{quote}
I'm thinking that we should instead create a separate Validator Factory per EntityManagerFactory (so each application will have its own factory for each persistence unit). This is easy for standalone applications. For clustered applications, will be a bit harder (but doable).
{quote}
Right, that is the way to go without modifying Validator. I wonder what we can/should do from our side to prevent this. Obviously serializing will help, but maybe we can offer other solutions as well. 

{quote}
Could you confirm that each application should have its own instance of a ValidatorFactory?
{quote}
AS things stands atm, yes

> Create a SerializableValidatorFactory wrapper that has enough information to either access or create a matching implementation when deserializing
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HV-460
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-460
>             Project: Hibernate Validator
>          Issue Type: Improvement
>          Components: validators
>            Reporter: Scott Marlow
>            Assignee: Kevin Pollet
>             Fix For: 4.3.0.next
>
>
> It should be possible, but it involves the serialization of a fair amount of classes. It feels to risky to do this is part of the 4.2 release which is coming out shortly.
> Let's have a closer look at this for an early 4.3 version. There will be a lot of refactoring due to JBoss logging and package restructuring. Hopefully we can address this as part of these changes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list