Integration with (Web hosting service) Java EE services 2.4.1 Integration with

Integration with Java EE services 2.4.1 Integration with JTA The Java Transaction API (JTA) is the standardized service interface for transaction control in Java enterprise applications. It exposes several interfaces, such as the UserTransaction API for transaction demarcation and the TransactionManager API for participation in the transaction lifecycle. The transaction manager can coordinate a transaction that spans several resources imagine working in two Hibernate Sessions on two databases in a single transaction. A JTA transaction service is provided by all Java EE application servers. However, many Java EE services are usable stand-alone, and you can deploy a JTA provider along with your application, such as JBoss Transactions or ObjectWeb JOTM. We won t have much to say about this part of your configuration but focus on the integration of Hibernate with a JTA service, which is the same in full application servers or with stand-alone JTA providers. Look at figure 2.6. You use the Hibernate Session interface to access your database(s), and it s Hibernate s responsibility to integrate with the Java EE ser vices of the managed environment. Figure 2.6 Hibernate in an environment with managed resources In such a managed environment, Hibernate no longer creates and maintains a JDBC connection pool Hibernate obtains database connections by looking up a Datasource object in the JNDI registry. Hence, your Hibernate configuration needs a reference to the JNDI name where managed connections can be obtained.
java:/MyDatasource
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.