This thread is actually a continuation of the following topic:
Hibernate DAOs Standalone vs. J2EE Environments
http://forum.hibernate.org/viewtopic.php?t=946551
i started a new thread so that i can hand out a few credit points, since
i would really need to understand this asap...
----------------------
i am currently trying to combine christians "Generic DAO pattern with
JDK 5.0" with a standalone application. since the usage of servlet-filters
isn't possible and because i would also like to avoid using spring, the proxy
method mentioned in the thread (above) seems to be the only other
possibility.
i am using hibernate 3.1rc3, so that i can set the "current_session_context_class"
configuration option to "thread" in order to use the ThreadLocal feature.
i do understand, that this creates a new session if none is available, but
how and where do i write the transaction demarcation code as well as the
code for closing the session, if this doesn't belong into the DAOs.
i need something between my application code and the DAOs to decouple the
application from the hibernate framework and the transaction code altogether.
one solution mentioned would be AOP, which i would like to avoid.
the "proxy" method sounds promising! has anybody done this and could give
me (a confused newbie) a quick explanation...
thanks,
nick
Hibernate version:
hibernate 3.1rc3
mysql 5
The generated SQL (show_sql=true):