Results 1 to 2 of 2

Thread: @Transactional only on public methods?

  1. #1
    Join Date
    Jun 2007
    Location
    Utah, USA
    Posts
    3

    Default @Transactional only on public methods?

    The @Transactional annotation seems like such a great idea, but I'm curious to know why it's only allowed on public methods. Is this an artifical limitation? Are there any plans to remove this limitation in the future? I didn't find anywhere in the docs that mentioned the reasoning behind it.

    Thanks in advance.

    nathan

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

    Default

    That is the way proxy based AOP works. A proxy is generated and only external method calls are being intercepted, external method calls can (normally) only be public methods.

    Check chapter 6 of the reference guide for an explanation of the proxy mechanism. Chapter 6.6 is the one for more information
    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

Posting Permissions

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