The goal is to format things like vendor phone numbers and tax id numbers after they are pulled from the database, and to strip formatting before they are stored in the database.
We have been using the orm event handler events and an interceptor that formats the data ORMPostLoad and then strips the formatting on ORMPreUpdate/ORMPreInsert, But we now have an issue when we fire another interceptor to create alerts from the vendor orm objects preinsert/preupdate methods. In the async alert interceptor we save an alert which flushes the orm session and resaves the vendor (because it thinks its dirty due to the formatting change) which retriggers the preinsert/preupdate methods on the model and causes duplicate alerts to be created.
I tried hooking into the presave event instead but I get the same behavior. I am thinking maybe I am going about the whole thing wrong and need some advice on how it could be done better.