EXT_STOP in MapperExtension not working as expected
Issue #1548
resolved
I started by implementing custom MapperExtension that checks whether there is already a column with identical value in the table. In before_insert(), I check for existing values and when these are found, I just use return EXT_STOP. But the object still makes it's way to database :S
From the documentation I can read out that it shouldn't make into the database...
Anyway, if this is not the case, it would be nice to have EXT_ABORT (or similar feature...)
Comments (2)
-
repo owner -
repo owner - changed status to wontfix
- Log in to comment
EXT_STOP discontinues further extensions from processing. It doesn't stop the actual operation.
If you want to change the flush plan before it goes in, use
SessionExtension.before_flush()
instead - at that point you'd want toexpire()
(orexpunge()
) the object which you don't want inserted.