Environment is:
* Java 6
* JBoss AS 5
* Hibernate 3.3
I'm a newcomer to Hibernate and JBoss -- it's the "new technology
direction" for our group, so I'm trying to run up the learning curve as
quickly as possible. I'm basing my architectural choices on what I see
as "best practices" in my reading combined with my own experience.
One source is
http://www.hibernate.org/42.html, particularly the
sections "Transaction demarcation with JTA" and "Implementing data
access objects (DAOs)". In addition, "Java Persistence with Hibernate"
also advocates using JTA whenever possible.
Overall, I want to keep the application/business logic as free as
possible from persistence dependencies. So I'm willing to put some extra
effort in at the outset to use available abstractions/frameworks or
build my own. Obviously I'd rather use existing ...
DAOs seemed like a great abstraction, but either need to have a Session
injected, or rely on a
HibernateUtil.getSessionFactory().getCurrentSession() pattern that
doesn't work in Shards. If I'm injecting Sessions into DAOs, I haven't
really bought much isolation from persistence dependencies.
JTA seemed to hold promise in this regard, but I don't know enough about
it yet, hence my question to this esteemed group of experienced
Shard-ers. :-) Is this the right way to go? Or am I chasing after
phantoms? What would constitute best practice at this juncture?
Thanks!
David