This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Hi! We have a 2 entity beans vendor and vendor details. We are inserting records in vendor and vendor details table via session bean, which in turn calls vendor and vendor detail entity . vendor calls vendor detail using cmr fields. The problem is with transaction handling. we wish to restrict tht if record is inserted in vendor than only it should be inserted in details, if some err while inserting in detail table , the whole process should be rolled back. Its like all or none case. How do we implement it, kindly suggest. Thanks
I would highly recommend you to read the Mastering EJB 2.0 book by Ed Roman. You can download it for free at www.middleware-company.com. Have a look at chapter 10, transactions. and check flat transactions and nested transactions. It's a good starting point to learn this... hope it helps..
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
I'll agree that you need to read a book on EJBs. This is a basic part of EJB design -- ALL transactions of this type are all-or-nothing. If you use container-managed transactions and set the Session bean to be either REQUIRED or REQUIRESNEW then this happens automatically. Is this not what you're seeing?