This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi all Would it be advisable to use session bean inspite of entity bean to perform any database transaction . If yes then tell y or else if not advisable tell what advantages do we gain from an entity bean Thanks in anticipation
Stateless Session Beans could be used for transactions involving more than one table. This is where your Java Transaction API and TX DataSource come into picture. You could get the Transaction object from the EJBContext's getUserTransaction() method and then, get your SQL statements in place within a try and catch block. Remember, you need to use the transaction.begin(), transaction.commit() and transaction.rollback() methods to ensure your transaction works fine !!! Hope this helps. Regards.
"shekarasankaran", Thanks for joining JavaRanch, but could you just take a quick look at the naming policy and edit your profile accordingly. Thanks! Simon Bartender (moderator) of "J2EE and EJB" forum