Can anyone tell me whats happening in the following scenario

Session Bean A has transaction attribute set as 'Required'  for all the methods
except for method f2 which has
the attribute 'RequiresNew'.Method f1 calls f2. and f2 calls another Entity Bean
B which updates some data.The TX attribute
for the Entity Bean is the default (ie 'Supports')

I have also put a println in the ejbStore of the entity Bean.

Session Bean A
     method f1()
     {
          System.out.println("Before calling f2..");
          f2();
          System.out.println("End of method  f1");
     }

     method f2()
     {
          System.out.println("Before calling Entity Bean..");
          Entity Bean B.updateData()
          System.out.println("End of method f2");
     }
}

The output sequence which i am getting is
Before calling f2..
Before calling EntityBean
End of method f2
End of method  f1
ejbStore called....

Its the occurence of ejbStore , that i am not able to understand.
Since method f2 has a transaction attribute of 'RequiresNew', a new transaction
should
be initiated at the beginning of method f2 and it should be committed after
completion of f2.So ejbstore should get called immediately
after method f2 is finished.

Any help is greatly appreciated....

- Kishor



Reply via email to