How does a bean access multiple databases in the same transaction?
Location: http://www.jguru.com/faq/view.jsp?EID=120647 Created: Aug 6, 2000 Modified: 2000-08-07 08:28:02.592 Author: Robert Castaneda (http://www.jguru.com/guru/viewbio.jsp?EID=4362) Question originally posed by srinivas rallapalli (http://www.jguru.com/guru/viewbio.jsp?EID=14867 In EJB 1.1, the way your EJB accesses multiple databases is the same as for accessing a single database: the datasource is defined in the deployment descriptor and looked up by the EJB using the JNDI environment naming context, that is, java:comp/env. It is the responsibility of the container/server to handle the transaction context propagation and the synchronization/2PC behavior. Warning: this functionality, accessing multiple databases in EJB within the same transaction context, is not supported by all products.
Related Questions
- If I throw a custom ApplicationException from a business method in Entity bean which is participating in a transaction, would the transaction be rolled back by container?
- My session beans call other bean methods within a transaction. Using bean-managed transactions, how should I take care of commit and rollback ?
- What is the difference between transaction database and data warehouse databases?