java - EJB Container Manage transaction execution -


in j2ee doc says,

although beans container-managed transactions require less coding, have 1 limitation: when method executing, can associated either single transaction or no transaction @ all.

question 1. understand unless declare transaction attribute notsupported or never, when method executing (suppose default required attribute) guaranteed method run in transaction right?

also need know suppose container manager transaction default required attribute below pseudo code happening,

class bean1{  public void m1(){     bean2.m2();  } }  class bean2{  public void m2(){  } } 

**question 2.**in case m2() in bean2 ran in new transaction or ran under same transaction m1() in bean1?

question 1. understand unless declare transaction attribute notsupported or never, when method executing (suppose default required attribute) guaranteed method run in transaction right?

yes, default container-managed transaction required, start transaction if 1 not exist. paragraph quoted unusual (obviously either transaction exists or not), i'm missing context give more complete explanation.

question 2. in case m2() in bean2 ran in new transaction or ran under same transaction m1() in bean1?

assuming both ejbs , no other transaction attributes applied (i.e., both ejb methods using default required attribute), both methods use same transaction. semantics transaction attributes described succinctly in javadoc transactionattributetype.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -