EdisonCP / sharp-architecture

Automatically exported from code.google.com/p/sharp-architecture
Other
0 stars 0 forks source link

Configuration of NHibernate Validator is not saved #97

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Initialize Nhibernate and NHibernate validator in global.asax
2. In NHibernate validator configuration try to implement
CustomMessageInterpolator
3. Try to change validation messages

What is the expected output? What do you see instead?
Validation message changes. I see default error messages.

What version of the product are you using? On what operating system?
SharpArchitecture_1.0.48.410_RC2. Windows Vista

As I found out it happens because of class Validator. In constructor new
instance of validation engine created. This new instance has its own
(default) settings, not the same as configured in xml file. 

To fix this error I have added static field to NHibernateSession where
validator engine is placed after configuration. It fixes the problem.  

Original issue reported on code.google.com by Hed...@gmail.com on 6 May 2009 at 7:43

GoogleCodeExporter commented 8 years ago
Could you please provide a patch and more details concerning the limitations 
that 
you're running into?

Original comment by wmccaffe...@gmail.com on 17 Jun 2009 at 5:02

GoogleCodeExporter commented 8 years ago
Here is a patch that solves the problem.

When you are creating new instance of validatorEngine in the Validator class it 
is
not configured and has default property values.

Original comment by Hed...@gmail.com on 22 Jun 2009 at 4:12

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the fix...that'll work nicely!  I've applied it locally and will 
have it
included in the next check-in (which should be 1.0 RTM).

Original comment by wmccaffe...@gmail.com on 15 Jul 2009 at 5:02