]
Steve Ebersole closed HHH-1091.
-------------------------------
Closing stale resolved issues
Can't write transparent CurrentSessionContext for BMT
-----------------------------------------------------
Key: HHH-1091
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1091
Project: Hibernate Core
Issue Type: Bug
Components: core
Reporter: Christian Bauer
Assignee: Steve Ebersole
Priority: Blocker
Fix For: 3.1 rc3
The purpose of the CurrentSessionContext was transparent client code for at least TLS and
BMT scenario:
getCurrentSession().beginTransaction();
// do stuff
getCurrentSession.getTransaction().commit();
This is not possible with the current implementations. JTASessionContext only works in a
CMT environment, or requires the user to begin and end a JTA transaction through the JTA
API. The code above does not work for BMT.
A custom BMTSessionContext can not take care of this issue, e.g. by starting a JTA
transaction for the user when he first calls getCurrentSession(). The user is then not
able to call getTransaction().commit(), but would also have to use the JTAPI to end the
transaction (Hibernate Transaction API is no-op of someone else started the JTA tx). One
way to hack this is a custom Transaction/TransactionFactory implementation that always
commits a JTA transaction, no matter who started it.
In other words, the new current session context feature is only useful because it
incorporates the TLS stuff into Hibernate. It does however not provide any real
portability. We need to clean up this mess before we finalize 3.1.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: