Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

transaction inception option

 
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
 
author and cow tipper
Posts: 5000
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
 
A wop bop a lu bop a womp bam boom! Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic