Jody Garnett ha scritto:
Andrea Aime wrote:
For the TransactionEvent I think you are going to need leading edge / trailing edge notification (or at least document *where* the even is fired). Easy example is DELETE being fired before the event occurs.
I stated it in the docs, but yeah, adding a flag to tell if the event
is trigger before or after the fact is useful.
Also note that the event hooks needed for validation are well documented and include a case you missed. Integrity checks need to come at the end of the transaction "PRE_COMMIT" as it were.
It's there, you missed it. TransactionPlugins has a:
void beforeCommit() throws WFSEXception
method that's designed exactly for that reason.
The integrity tests actually need access to a map of all the data harmed over the course of the event ... a nice way to do that would be to:
1. break out different event types for each notification PreTransactionNotification, TransactionInsertNotification, TransactionUpdateNotification, TransactionPreDeleteNotification, TransactionPreCommitNotification, TransactionPostCommitNotification, TransactionPreRollbackNotification, TransactionPostRollbackNotification, PostTransactionNotification ... and define your listener with a method for each phase in the workflow (with appropriate data access for that stage of the workflow, example a FID set for a PreDelete).
I agree we need to convey the meaning, but I'm not gonna add all
of these methods, they would make for ridicously long implementation classes. The first methods are covered by TransactionListener, I just need to add a before/after flag. Pre commit we do have, post commit and post rollback too. Pre rollback, it does not make sense in my opinion.
This would let a single implementation collection some information (like say the bounds) during a PreDelete, and then that information in a PreCommit (perform an integrity check).
Yup, that's how I wanted to re-insert back validation.
How much detail should we expect from proposals? For long term items like this one I am inclined for "more" even though I am very happy with the direction you are taking.
Tell me what do you need more. Motivations, design... on trunk you
can see an initial implementation too.
Cheers
Andrea