| Author |
CMP & BMT
|
XueRong Weng
Greenhorn
Joined: Jun 09, 2003
Posts: 3
|
|
I have a question about transaction. For component-managed persistance session beans and MDBs, can they use bean managed transaction? Are they contradict? Thanks in advance!
|
 |
Sudd Ghosh
Ranch Hand
Joined: Oct 23, 2002
Posts: 187
|
|
Any session or MDBs can use either container managed transaction (CMT) demarcation or BMT . 2.0 Entity beans must use only CMT. Persistence has nothing to do with transactions, these are totally different areas. Only the implementation has some kind of similarity. Both CMP and CMT are used thru deployment descriptor elements, whereas BMP uses progarmming thru JDBC and BMT uses programming thru javax.transaction APIs. Thanks, Sudd
|
Sun Certified Java2 Programmer-1.4<br />Sun Certified Web Component Developer for J2EE Platform<br />Sun Certified Business Component Developer for J2EE1.3
|
 |
XueRong Weng
Greenhorn
Joined: Jun 09, 2003
Posts: 3
|
|
Thanks a lot for clarifying the concept. I'm much clearer now. I have one more question. On my book, it is stated BMT beans must not use the setRollbackOnly() and getRollbackOnly. What's the reason behind?
|
 |
John Chandra
Greenhorn
Joined: Jun 27, 2003
Posts: 10
|
|
BMT beans (only session and MDB) call setRollbackOnly() and getStatus() method on the javax.transaction.UserTransaction, which you get from calling javax.ejb.EJBContext.getUserTransaction() method. BTM bean will get IllegalStateException if it invokes setRollbackOnly() or getRollbackOnly() directly on EJBContext. Hope this helps.
|
 |
 |
|
|
subject: CMP & BMT
|
|
|