I knew ORM tools, such as Hibernate, have their own transaction management mechanism. We can also harness transaction by using JDBC directly. And DBMS has its transaction facilities either. I wonder that in which layer(s) the transaction is actually implemented in a J2EE application? I guess that the transaction in Hibernate is built upon on JDBC, in turn the JDBC rely the underlying DBMS to realize the Transaction. is it fair?
Regards!
In the service layer, of course.
In EJB, they’re on session beans.
In Spring, they’re on services.
Services know about units of work. That’s why they own the transaction context.