Announcement Announcement Module
Collapse
No announcement yet.
NameMatchTransactionAttributeSource.isMatch(...) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NameMatchTransactionAttributeSource.isMatch(...)

    Currently the isMatch method only checks for XXX* and *XXX matches. Since this is a way strickt, I ran into an issue related to fully specifying the method name.

    So it wasn't that hard to come up with something like this:

    Code:
    <bean...>
    ...
                    <property name="transactionAttributes">
                            <props>
                                  <prop key="myMethod">PROPAGATION_REQUIRED,read_only</prop>               
                            </props>
                    </property>
    </bean>
    So I guess the method should for equality, too.


    Thanks,

    Martin (Kersten)[/code]

  • #2
    Have you tried this :-)

    If you look at the code a bit better, you'll see that isMatch is called only _after_ an exact match (equality test) fails.

    Regards,

    Comment


    • #3
      :shock: Ummm, ähhh,... Aha!

      Well I see, this one does the trick:

      Code:
      TransactionAttribute attr = &#40;TransactionAttribute&#41; this.nameMap.get&#40;methodName&#41;;
      		if &#40;attr != null&#41; &#123;
      			return attr;
      		&#125;
      I had a problem half a year ago. I visit the source and though hey no equal match, just add stars. So I changed it and well I guess ... Uhm don't know.

      But look at this:

      Code:
      else &#123;
      			// look up most specific name match
      			String bestNameMatch = null;
      &#91;...&#93;
      The code is saying something to me: "Please split me up, I am a method responsible for two things in one..."

      Anyways, problem solved! - Thanks!

      Martin (Kersten)

      Comment

      Working...
      X