Uwe Schäfer wrote:
Subclass WebRequestCycle, and construct it with an EntityManager.

thanks! That may well be an alternative to the common ServletFilter-pattern.

Well, err, yes. ;-)

One question: isn´t it a little better to have the ThreadLocal Holder for the EntityManager separate from the RequestCycle, but notified of its events? Somewhat a 'listener' that registers itself ?

If you have one, then sure. Whatever feels cleanest to you. There is no single best way with all this stuff.

My DAOs actually use Spring's HibernateTemplate, so getting hold of a session in there is done using sessionFactory.getCurrentSession(). It's a bit different in your case with JPA stuff.

This would decouple things as well as make configuration at runtime easier. (The 'Favor decoration over inheritance' thing.)

What am i missing?

Nothing, it sounds like. ;-)

Regards,

Al


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to