Results 1 to 4 of 4

Thread: Default transactionAttribute if method name doesn't match?

  1. #1
    Join Date
    Jan 2006
    Location
    Seattle, Washington
    Posts
    467

    Default Default transactionAttribute if method name doesn't match?

    If while using a TransactionProxyFactoryBean, if the method name masks in the transactionAttributes don't match a particular method in the target class, what exactly will be used if that method is called? For instance, will it essentially use PROPAGATION_REQUIRES_NEW, or something else?

  2. #2
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    Quote Originally Posted by dkarr View Post
    If while using a TransactionProxyFactoryBean, if the method name masks in the transactionAttributes don't match a particular method in the target class, what exactly will be used if that method is called?
    I wonder what you mean with that method in case no method matched

    Nothing happens then. The object is still wrapped by a proxy, but no method calls actually result in changes in the transaction behavior. It's just acting as there would not be the proxy.

    Joerg
    This post can contain insufficient information.

  3. #3
    Join Date
    Jan 2006
    Location
    Seattle, Washington
    Posts
    467

    Default

    Normally, the method mask is supposed to match the methods in the target class (the DAO class, usually), correct? Well, in the instance I'm describing, I realized that the method called in the target class to do the work isn't covered by the method mask.

    So, assuming this method is doing a "save", and a previous step in the same request did a retrieve from the database, would the second call result in a second session or transaction, as if it defaulted to "PROPAGATION_REQUIRES_NEW"?

    I'm just trying to look for details that might explain some symptoms we were seeing.

  4. #4
    Join Date
    Sep 2004
    Posts
    1,086

    Default

    No transaction is started then, so in effect it works just like "SUPPORTS" propagation.

Posting Permissions

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