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?
- would it be better to opt for Hibernate template based DAOs?
- What kind of transaction manager would be suggest-able and should we go for AOP-based transaction managementWhere
- where to instantiate session and and where to close the sessions to effectively consume connections from connection pooling.
- 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)
- 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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…