Community
Participate
Working Groups
Build Identifier: Currently, IRepository.WriteAccessHandler has only a pre-commit callback (handleTransactionBeforeCommitting). A post-commit callback would be useful too. In our case, we need such a post-commit handler in order to be notified of every successful commits. We extract information from the CommitContext and synchronize an external model with it. Reproducible: Always
Created attachment 161263 [details] Adds a "handleTransactionAfterCommitting" method to IRepository.WriteAccessHandler. This patch does not apply nicely to HEAD anymore. However the failed hunks are easy to fix.
Hi Cyril, thank you for this patch. Note that I change the parameter order in the new handler method. Please confirm the following: 1) The number of lines that you changed is smaller than 250. 2) You are the only author of these changed lines. 3) You apply the EPL to these changed lines.
(In reply to comment #2) > Hi Cyril, thank you for this patch. Note that I change the parameter order in > the new handler method. > Do you need a new one that applies cleanly to HEAD? > Please confirm the following: > > 1) The number of lines that you changed is smaller than 250. Yes. > 2) You are the only author of these changed lines. Erwin Betschart is the author of the patch. He is the only author. > 3) You apply the EPL to these changed lines. Yes, EPL is alright. Thank you.
Thank you, Erwin ;-) Committed to HEAD
Attention: The new call-back hook has been renamed to handleTransactionAfterCommitted() !!!
Example: IRepository repository = CDOServerUtil.createRepository("myrepo", store, props); repository.addHandler(new IRepository.WriteAccessHandler() { public void handleTransactionBeforeCommitting(ITransaction transaction, IStoreAccessor.CommitContext commitContext, OMMonitor monitor) throws RuntimeException { System.out.println("About to commit " + transaction); } public void handleTransactionAfterCommitted(ITransaction transaction, IStoreAccessor.CommitContext commitContext, OMMonitor monitor) { System.out.println("Committed " + transaction); } });
Available in 3.0 GA: http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/