Print Page | Close Window

Random Validation Issue

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1896
Printed Date: 16-Apr-2024 at 5:21am


Topic: Random Validation Issue
Posted By: orcities
Subject: Random Validation Issue
Date Posted: 14-Jun-2010 at 9:11am
My product has been live for quite some time. I am now getting an error thrown on validation, which I doubt it actually is. When the user modifies one specific entity and tries to save a "Save failed - Entity Validation Failure(s)" error is thrown.
 
The problem is that it doesn't say which entity. I have checked the entire PersistenceManager.DataSet to see if I could find the issue and I cannot.
 
I have tried looking for the entities in the PM with the rowstate of modified and looking at it's properties and there is no issue. I have validated that entity by forcing validation to see if it returns the validation error and it does not. But, on save after this entity has been modified there is an error.
 
SaveResult:
Failed - Normal Error: Save failed - Entity Validation Failure(s)
 
Stack Trace:
   at IdeaBlade.Persistence.PersistenceManager.DoSaveDataSet(IEnumerable pDataRows, SaveOptions pSaveOptions)
   at IdeaBlade.Persistence.PersistenceManager.SaveChanges(IEnumerable pDataRows, SaveOptions pSaveOptions)
   at IdeaBlade.Persistence.PersistenceManager.SaveChanges()
   at LOC.CEMS.EventManagement.EventManagementPageController.SaveHandler(Object sender, EventArgs e) in C:\Development\CEMS\Source\UI\EventManagement\PageControllers\Event\EventManagementPageController.cs:line 3



Replies:
Posted By: GregD
Date Posted: 15-Jun-2010 at 4:05pm
Originally posted by orcities

My product has been live for quite some time. I am now getting an error thrown on validation


After what change did this start happening?


Originally posted by orcities

When the user modifies one specific entity and tries to save a "Save failed - Entity Validation Failure(s)" error is thrown.
The problem is that it doesn't say which entity. I have checked the entire PersistenceManager.DataSet to see if I could find the issue and I cannot.


What is causing the validation to be run? DevForce Classic doesn't perform validation on a save unless your code asks it to.



Originally posted by orcities

I have tried looking for the entities in the PM with the rowstate of modified and looking at it's properties and there is no issue.


You have access to the collection of entities being saved in the PersistenceManager's Saving event. Normally that's where people perform instance validation in DFClassic.


Posted By: orcities
Date Posted: 15-Jun-2010 at 5:18pm

1. No change. User was usinging it successfully one day then the next it wouldn't work.

2. Triggered Validation. Instance and OnPostSet
 
3. I have looked at all entities in the dataset being saved. No entity should fail validation. The specific entity that is failing, at the time, has valid data.


Posted By: GregD
Date Posted: 15-Jun-2010 at 10:11pm
Instance and OnPostSet, applied to a particular verifier, means that verifier will be run after a set of the triggering property (OnPostSet), and also when instance validation is ordered (Instance). But you still have to order instance validation explicitly (unlike triggered validation); and it seems to be instance validation that is at issue here. What is ordering the instance validation? (It is not DevForce!)

>> No change. User was using it successfully one day then the next it wouldn't work.

Code doesn't change spontaneously, so the only thing that could account for that would be that the data was somehow put into an invalid state, so that a test that was passed yesterday is not being passed today.

Suppose an invalid value were introduced outside your app (so that no triggered validation occurred at the time the value was changed). This still wouldn't cause Devforce to reject the save unless you order successful instance validation as a condition for the save. Of course, the back-end database could still reject the save it it contained data that broke *it's* rules.


Posted By: orcities
Date Posted: 16-Jun-2010 at 7:02am
Regardless of how validation is being performed. The data is valid. And it is throwing a generic error that I can not track. It is a DevForce error.
 
Every value in the PM DataSet is valid. They all pass validation but fail on save.


Posted By: GregD
Date Posted: 16-Jun-2010 at 1:44pm
Well, apologies, but I don't know how to repro this issue. Can you send us a small console app & database (minimal, preferably just one table) that does so?



Print Page | Close Window