java - Declarative Transaction Management in Spring behaving unpredictably -
I have a Spring + Hibernate application with declarative transaction management, I have a service (
FooService < / Code>), which has 2 public methods MethodA and MethodB . The client will be call with Method A which in turn will call MethodB . client - & gt; Method A - & gt; Methodeb I have to start with the transaction methib. It is a snippet from my spring app - Reference:
& Lt; Property Name = "Transaction Properties" & gt; & Lt; Theater Content & gt; & Lt; Support key = "methodeb" & gt; PROPAGATION_REQUIRED, -FooException & lt; / Prop & gt; & Lt; / Theater & gt; & Lt; / Property & gt; & Lt; / Bean & gt; However, when I call MethodA to my customer, it does not make a transaction proxy when calling MethodB goes . If I add MethodA too to the Bean configuration in the application context, the transaction proxy (start MethodA , as expected) is started . Why is it like this? Can I make transactions only from Methib?
client - & gt; Method A - & gt; Methodod
I want to start the transaction only with Math.
This can not work Method A and method B are within the same proxy.
The only proper thing is that the method B has to be taken in a different bean.
BTW: It has been asked many times, here are some of my last answers:
-
-
- < / Li>
Comments
Post a Comment