If we have a web application which has

  • heavy UI (Spring MVC + JQuery with JSON)
  • Hibernate with JPA annotations being the domain model
  • extend Spring-provided DAO to code DAO layer
  • JBOSS being the app server with Oracle as backend
  • Datasource (JNDI) based connection pooling (Not an XA rather Local data source)
  • also has access to multiple data sources (dealing with multiple DB)

Behaviorally, lot of Data retrieval (70%) and update of data being 30%
What would be the best practices for the following to effectively consume DB connections and also see to that there is no much leakage at connection usage?

  1. would it be better to opt for Hibernate template based DAOs?
  2. What kind of transaction manager would be suggest-able and should we go for AOP-based transaction managementWhere
  3. where to instantiate session and and where to close the sessions to effectively consume connections from connection pooling.
  4. It is true that we need to handle transactions from Service layer but what happens to sessions would they be waiting for longer time (we are not using any opensessioninviewFilter)
  5. which layer is better to handle the checked exceptions (business exceptions) and runtime exceptions.

Sorry for this being bit lengthier question, however I see that this is being a common query and I tried consolidating it. Appreciate your patience and guidance. Thanks for your help.

Edit
Report