views:

21

answers:

1

Hi everybody, lately I have been using a lot Castle ActiveRecord framework and it has worked fine until I found a strange behaviour. For some reasons I don't understand the onFlushDirty is triggered twice in some situations. It is even triggered when I make a simple query. I'm really confused cause I'm trying to make auditing and as I read data the onFlushDirty is triggered and it saves identical data.

How can I avoid this behaviour?

Thanks in advance

A: 

I think I resolved my issue but I don't know why this happens.

First of all, the data I have in database has null values in some date fields and integer fields, (the data came from a migration from Btrieve).

When I loaded the data in a datagrid the onFlushDirty event triggered, when I debugged and watched the data I saw that on a date field with null value it had a previousState with null and currentState with '0001-01-01 00:00:00'. I changed in the database the nulls with '0001-01-01 00:00:00' in the case of date fields and zero for the integer fields and the onFlushDirty event never triggered again when I loaded the data on the datagrid.

But the question still remains. Why does this happens or is it correct this behaviour?

nmiranda

related questions