Results 1 to 3 of 3

Thread: TransactionProxyFactoryBean and methods within the target

  1. #1
    Join Date
    Aug 2004
    Location
    New York, NY
    Posts
    46

    Default TransactionProxyFactoryBean and methods within the target

    I have a fairly simple question about the behavior of TransactionProxyFactory Bean. Does it itercept calls from one method to another in the target class?

    For example let's say I some methods that don't need a transaction (like find type methods) and only one or two that do (like save and delete).

    Now, I introduce another method that doesn't need a transaction itself and in all actuallity needs no transaction, that calls the save method. Would a transaction start and commit for the call to the save method?

    If not, is my only recourse to use a Facade that calls the two methods seperately?

    Thanks,
    Patrick

  2. #2
    Join Date
    Aug 2004
    Location
    Hawaii, US
    Posts
    225

    Default

    Short answer is that no, if you are inside an advised and proxied object, then calls from within the object to this will not go through the proxy. This would only happen if you were using AspectJ, for instance, to advise your objects.

    See a discussion of this at:
    http://forum.springframework.org/showthread.php?t=9956

    There is a way to interact with your own proxy, but I have not figured out how to completely do it when BeanNameAutoProxyCreator. The above post has more details.
    Last edited by robyn; May 19th, 2006 at 05:46 AM.

  3. #3
    Join Date
    Aug 2004
    Location
    New York, NY
    Posts
    46

    Default

    Seth,

    Thanks for that thread. I had figured out things by stepping through the debugger, and sure enough, the proxy only applies at the top most method. Bummer.

    We are trying to keep our services clean of dependencies on Spring itself, so I created a facade to perform the method calls and get the transactions the way I want them.

    Thanks again,
    Patrick

Similar Threads

  1. Replies: 5
    Last Post: Jan 23rd, 2008, 04:30 PM
  2. Customize MultiActionController methods?
    By dholmes97 in forum Web
    Replies: 5
    Last Post: Oct 6th, 2006, 08:42 AM
  3. Replies: 2
    Last Post: Jul 11th, 2005, 03:53 PM
  4. Replies: 0
    Last Post: Apr 1st, 2005, 10:46 AM
  5. Replies: 2
    Last Post: Mar 31st, 2005, 09:26 AM

Posting Permissions

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