Okay, I assume this is because of how the CommitAfter advise is applied - when I write my own advice, I have no trouble finding methods that only declare the annotation on the service method implementation. This method, for example, will successfully advise service implementations even when there's no annotation on the interface method:
@Advise @Match("*") public static void supportCommitAfterOutsideRequests( /* CommitAfterAdvisor advisor, */MethodAdviceReceiver receiver) { // advisor.advise(receiver); MethodAdvice commit = new MethodAdvice() { public void advise(MethodInvocation invocation) { System.err.println("=========TX BEGIN"); invocation.proceed(); System.err.println("=========TX COMMIT"); } }; for (Method m : receiver.getInterface().getMethods()) { if (receiver.getMethodAnnotation(m, CommitAfter.class) != null) { System.err.println("ADVISING " + receiver.getInterface().getSimpleName() + "." + m.getName() + "()"); receiver.adviseMethod(m, commit); } else System.err.println("NOT advising " + receiver.getInterface().getSimpleName() + "." + m.getName() + "()"); } } Having said that, despite the fact that I have put @CommitAfter on the service method AND on the service interface method, the transactions aren't being committed. Q: Is there any way to tell what advisors or decorators are in place around a service method? On 1 April 2013 13:15, Thiago H de Paula Figueiredo <thiag...@gmail.com>wrote: > On Mon, 01 Apr 2013 13:36:39 -0300, Michael Prescott < > michael.r.presc...@gmail.com> wrote: > > How do I make @CommitAfter work outside of a normal web request? >> > > public class PeerMessageProcessorImpl implements PeerMessageProcessor { >> @Inject >> private Session session; >> >> @CommitAfter >> public void receive(Message message) { >> Object payload = message.getObject(); >> session.save(payload); >> } >> > > Due to a limitation in the Tapestry-IoC service proxy creation, you need > to put the @CommitAfter annotation in interface method, not in the class > method. > > -- > Thiago H. de Paula Figueiredo > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > users-unsubscribe@tapestry.**apache.org<users-unsubscr...@tapestry.apache.org> > For additional commands, e-mail: users-h...@tapestry.apache.org > >