Speaker Topics - No Fluff Just Stuff

Hibernate and J2EE Transaction Integration

Hibernate is quickly becoming a viable alternative to the EJB Entity Bean and DAO persistence models. More and more applications are being written using Hibernate, and many existing applications are replacing legacy Entity Bean or DAO persistence models with Hibernate. Hibernate has it's own transaction manager and transaction API that is simple to configure and use for single resource, web-based applications. However, things get a bit more complicated when you consider using Hibernate as the persistence model for larger server-based J2EE Enterprise Applications. If you are planning on using Hibernate in conjunction with your existing app server, then you should attend this session. In this session we will take a look at how the Hibernate transaction model works and how to integrate Hibernate into the JTA transaction model within J2EE. Through this session you will learn where Hibernate used as-is will cause runtime exceptions when integrating with JTA declarative transactions. You will also see that we in fact cannot use the Hibernate Transaction API for JTA Declarative Transaction processing, and what steps are required to integrate with JTA given this fact. Also, you will learn how the Hibernate Transaction API violates the EJB 2.1 spec, and ways to get around these violations. We will end this session with a brief discussion about the application architecture considerations with integrating Hibernate as our persistence model for existing large-scale J2EE applications.

Agenda:

  • Managed vs. Non-managed Environments
  • Hibernate Transaction Component Relationships
  • Hibernate Transactions in a non-Managed Mode
  • Using JNDI for the SessionFactory
  • Integrating Hibernate with JTA Declarative Transactions
  • Integrating Hibernate with JTA Programmatic Transactions
  • Application Architecture Discussion

About Mark Richards

Mark Richards is an experienced, hands-on software architect involved in the architecture, design, and implementation of microservices architectures, service-oriented architectures, and distributed systems. He has been in the software industry since 1983 and has significant experience and expertise in application, integration, and enterprise architecture. Mark is the founder of DeveloperToArchitect.com, a website devoted to helping developers in the journey to software architect. He is the author of numerous technical books and videos, including the recently published Fundamentals of Software Architecture, Microservices AntiPatterns and Pitfalls, Microservices vs. SOA, the Software Architecture Fundamentals video series, The Enterprise Messaging video series, Java Message Service, 2nd Edition, and contributing author to 97 Things Every Software Architect Should Know. Mark has a master’s degree in computer science and is a regular conference speaker at the No Fluff Just Stuff (NFJS) Symposium Series. He has spoken at hundreds of conferences and user groups around the world on a variety of enterprise-related technical topics.

More About Mark »