Re: [Hibernate] Transaction options
On Sep 1, 2005, at 10:58 PM, Justen Stepka wrote: This might include a HibernateHelper class similar to Hibernate in Action along with some type of session in view filter. Even if this does not make it into the source code, this clearly is a section that could be added to the documentation: web-tier best practices or something. http://www.hibernate.org/42.html http://www.hibernate.org/43.html --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Transaction options
On Sep 1, 2005, at 11:21 PM, Christian Bauer wrote: There is no problem without EJBs, it's in fact very trivial three- line code. What I described is a problem _with_ EJBs, container- managed transactions, and a Long Session pattern. And to make this very clear: The problem is a problem of convenience, using the getCurrentSession() functionality instead of maintaining a Session yourself in a (not very appropriate) ThreadLocal or (proprietary) TransactionLocal for the duration of the JTA transaction. --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Transaction options
On Sep 1, 2005, at 10:58 PM, Justen Stepka wrote: 1. Long Session and getCurrentSession() doesn't work. Can probably be solved by extending/providing a custom factory that doesn't open/ close on synchronization, but disconnect and reconnect. Users choice since we can't enforce a close() and we should always do that. I would have to agree. Once of the biggest problems outside of the initial scope of having to write Hibernate mappings, and getting it all up and running is how to handle TX when you're not using EJBs. There is no problem without EJBs, it's in fact very trivial three- line code. What I described is a problem _with_ EJBs, container- managed transactions, and a Long Session pattern. --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] Transaction options
Two things I realized recently: 1. Long Session and getCurrentSession() doesn't work. Can probably be solved by extending/providing a custom factory that doesn't open/ close on synchronization, but disconnect and reconnect. Users choice since we can't enforce a close() and we should always do that. 2. OSIV with EJBs: I think BMT with a servlet filter + getCurrentSession() should work, if I'd have a custom factory that doesn't flush/close. This would avoid the ThreadLocal issues with EJBs. Don't know if this is a real problem since everybody seems to be happy with ThreadLocals in EJB containers. It's not good though. Does anybody want to have a look into that and write/test custom transaction factories? The 1. could be a good Wiki page, the 2. could probably even be included. --- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel