Hi,
DAOs abstract client code from making (Hibernate) specific data access calls.
For long sessions, however, it looks like there is no abstraction from storing the Hibernate session in e.g. the Web session context. Assuming a requirement of different persistence frameworks, wouldn't it make sense to add such an abstraction level too (i.e. abstract from Hibernate session + transaction, e.g. by adding a thin layer on top of Hibernate ) ?
Note: we are currently targeting for Hibernate 3.0, taking a "flattened" approach bas on the Hibernate 3.1 DAO factory approach.
When adopting Hibernate 3.1 later, it looks like the TransactionInterceptor can be useful; however this only supports session per request ?
Regards,
- Fernand.
|