Results 1 to 4 of 4

Thread: Some way to intercept @Transactional method call after commit?

  1. #1

    Default Some way to intercept @Transactional method call after commit?

    Hi,

    I know that @Transactional annotation is just a convenient way to construct TransactionProxyFactoryBean and other boilerplate configuration which allow for any type of customization, such as including custom interceptors, but I would like to keep using @Transactional *and* somehow specify somewhere in configuration to call my own interceptor so that I can do some stuff after transaction commits/rollbacks (outside of transaction).

    Is that doable now?

    regards,
    Vjeran

  2. #2
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

    Have a look at TransactionSynchonizationManager and the TransactionSynchrionization interface.

  3. #3
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    Simply execute your interceptor before the transactional one it is all about ordering and for that there is an order property on the tx:annotation-driven.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  4. #4
    Join Date
    Nov 2009
    Posts
    2

    Default

    Sample implementation of proposed solution can be found here:
    Spring database transactions before sending JMS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •