Announcement Announcement Module
Collapse
No announcement yet.
Declarative transaction will not work when .... ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Declarative transaction will not work when .... ?

    Hi,

    I have declared ClassA.methodX() as PROGATAION_REQUIRED.
    The transaction mechaism works fine, when other object
    invokes ClassA.methodX() directly. If methodX() throws Exception, all data are rollback successfully.

    But if I create another method as ClassA.methodY(),
    which has no transaction property, and it will invoke ClassA.methodX(),
    such as:
    Code:
    ClassA {
    
        public void methodY() {
                this.methodX();
         }
         
        public void methodX() {
                ....
         }
    
    }
    Then another object invoke methodY() first,
    -> methodX() is ivoked -> methodX() throws Exceptions,
    data are not rollback !?

    Is it normal?

    ps. methodX() will invoke other methods, some are also declared as PROGATAION_REQUIRED

    ps. I am using Spring 1.1.1

    Thanks for any comment!

  • #2
    I'm not sure I understand your example exactly, but take a look at this:

    http://forum.springframework.org/showthread.php?t=11656

    In summary, calling methods via the this reference bypasses the transaction proxy. You must direct intra-object calls through the proxy.
    Last edited by robyn; May 19th, 2006, 04:47 AM.

    Comment


    • #3
      Originally posted by rhasselbaum
      I'm not sure I understand your example exactly, but take a look at this:

      http://forum.springframework.org/showthread.php?t=11656

      In summary, calling methods via the this reference bypasses the transaction proxy. You must direct intra-object calls through the proxy.
      Dear rhasselbaum,
      I think you understand my problem.
      Thanks for your comment, it helps me a lot.

      It looks like I cann't just write business methods too feely....

      Is there any more official document to talk about this topic?

      Thanks!
      Last edited by robyn; May 19th, 2006, 04:48 AM.

      Comment

      Working...
      X