My current standard architecture for complex
JSF programs with extensive database interaction is to use the Spring Framework to construct and wire the persistent logic objects and inject the Spring beans into JSF backing beans as needed.
The persistency subsystem has 3 layers:
1. Business-logic persistency ("service")
2. Database-logic persistency ("dao")
3. Domain model objects (via JPA)
The dao layer consists of Spring beans that each deal with a single table (or sometimes parent/child table). The methods are all basic CRUD and finder methods, not business-related.
The service layer consists of beans that support specific business functionality. They provide the support needed to co-ordinate the storage and retrieval of related sets of domain-model objects (working sets). The methods within this layer are each implementations of a single transaction. The service beans are injected with dao beans that handle the per-table support. The service methods are injected as managed properties into JSF backing beans, or occasionally into application business-logic beans. The domain objects at these higher levels are detached and non-transactional.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.