Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

transaction inception option

 
Mohit Sinha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Typically in java EE app the transaction scoping starts at business layer where the underlying DAO's can be bound in a single transaction.
I have seen the transaction being handled declaratively using Spring or EJB where in the transaction kicks in at the business layer nesting the required DAO's.
Subsequently the DAO's interact with their Hibernate counterparts.

But how can the transaction be injected (declarative or programmatic) fashion when the business layer is java POJO's and not something like EJB or Spring.

Let me know what is the best way to implement here.

Mohit
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you've got a good grounding on how to coordinate transactions amongst various J2EE/JEE layers.

Even though you have a number of POJOs representing your data layer, usually there's some type of service layer, or application service that will coordinate and organize how these various POJOs are persisted to the database. It's in this application service class that you can inject your transaction management, be it programmatic, or declarative if you have the declarative capabilities.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic