steve wrote:
So how do you propose a call to org.hibernate.SessionFactory.getCurrentSession() know about the "current http servlet request"?
I completely get what you are saying. JBoss needs the JTA demarcation as a hook in to start the process. The more I think about it, the more I understand the that problem. I guess what I want clarification on is if that problem is mearly that -- a hook is needed -- or is it also because of the fundemental design of the Session?
So, given that I can't use getCurrentSession(), is there anything that keeps from doing the following:
1) Continue to use the HAR deployment, but do my own Session management?
Having a package structure that will auto-add the config files without having to specifiy each one would be nice. I am assuming that the SessionFactory is bound to JNDI at deployment-time, so if I manage the retrieval of it, creating sessions and binding them myself to the requests, are there any issues?
2) Use a single 'long-lived' Session for each HTTP request that will participate in at least 1, but usually mroe than one CMT JTA-TX, including doing retrievals that are not in the context of a JTA-TX?
Everything I have read leads me to believe that there is no issue with this, but the JTA requirement to use getCurentSession(), I just wanted to confirm.
Thanks!