RE: [Hibernate] ThreadLocalSessionContext javadoc inconsistency
Well, it might be doable by slightly changing the CurrentSessionContext intf slightly. Instead of currentSession(), have currentSession(SessionFactoryImplementor) Additionally for ThreadLocalSessionContext, change the bind() and unbind() methods appropriately. Its internal ThreadLocal could then keep a map of SessionFactory -> Session. -Original Message- From: Max Andersen Sent: Monday, October 03, 2005 9:21 AM To: Steve Ebersole; Hibernate development Subject: Re: [Hibernate] ThreadLocalSessionContext javadoc inconsistency On Mon, 03 Oct 2005 16:15:01 +0200, Steve Ebersole <[EMAIL PROTECTED]> wrote: > Here's another concern with the current impl for > ThreadLocalSessionContext: the static accessors. Basically the way > this is setup right now, users will nt be able to use this > simultaneously for multiple session-factories... oh - thats not nice. This becomes a global thing...would it make sense to have getCurrentSession(string name); ...hmm i guess not...it is equally "hard" to keep track of the current name as well as the current sessionfactory. bummer...i had hoped to use this in the eclipse plugin, but cant because I actually here by its nature can/will have multiple session-factories with different strategies. oh well - its still a good thing for 98% of the worlds applications ;) /max > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Max > Rydahl Andersen > Sent: Saturday, October 01, 2005 10:32 AM > To: Hibernate development > Subject: [Hibernate] ThreadLocalSessionContext javadoc inconsistency > > hi, > > javadoc for ThreadLocalSessionContext state: > > "it unsafe for this impl to actually generate Session instances; thus it > > does not" > > but at currentSession it does the following: > > if (current == null) { > log.debug("Current thread doesn't have a > session, opening new"); > bind(factory.openSession( null, > > Which one should it be ? > > btw. any reason why we can't return Session instead of classical.Session > ? > -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://www.jboss.com/events/jbossworld JBoss World Barcelona 10-12 October --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] ThreadLocalSessionContext javadoc inconsistency
Steve Ebersole wrote: Ah yes! Forgot that it already knows about the SF to which it is bound via its constructor. So really the only changes needed here is to the "static portion" of ThreadLocalSessionContext. Well, it's a trivial implementation. We should either include it or at the very least post it to the Wiki. If we add it to the distro, then at least I'd have more then 3 things in that new package :) I could even refactor the Synchronization into a top-level class; then I'd have 5 things in that package :)) Make it so :) Btw, I'd like to change the Session.getTransaction() method to return null if no transaction is going on. Otherwise we really don't have a way to test if the Session has a transaction. I'd like to do session.getTransaction().commit() in an interceptor without starting one. So either getTransaction() has to return null or we need a session.hasTransaction(). --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] ThreadLocalSessionContext javadoc inconsistency
On Mon, 03 Oct 2005 16:31:58 +0200, Steve Ebersole <[EMAIL PROTECTED]> wrote: Well, it might be doable by slightly changing the CurrentSessionContext intf slightly. Instead of currentSession(), have currentSession(SessionFactoryImplementor) Additionally for ThreadLocalSessionContext, change the bind() and unbind() methods appropriately. Its internal ThreadLocal could then keep a map of SessionFactory -> Session. +1 on at least giving the currentSession method some info to distinguish between SessionFactories. Why SessionFactoryImplementor and not just SessionFactory ? /max -Original Message- From: Max Andersen Sent: Monday, October 03, 2005 9:21 AM To: Steve Ebersole; Hibernate development Subject: Re: [Hibernate] ThreadLocalSessionContext javadoc inconsistency On Mon, 03 Oct 2005 16:15:01 +0200, Steve Ebersole <[EMAIL PROTECTED]> wrote: Here's another concern with the current impl for ThreadLocalSessionContext: the static accessors. Basically the way this is setup right now, users will nt be able to use this simultaneously for multiple session-factories... oh - thats not nice. This becomes a global thing...would it make sense to have getCurrentSession(string name); ...hmm i guess not...it is equally "hard" to keep track of the current name as well as the current sessionfactory. bummer...i had hoped to use this in the eclipse plugin, but cant because I actually here by its nature can/will have multiple session-factories with different strategies. oh well - its still a good thing for 98% of the worlds applications ;) /max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Max Rydahl Andersen Sent: Saturday, October 01, 2005 10:32 AM To: Hibernate development Subject: [Hibernate] ThreadLocalSessionContext javadoc inconsistency hi, javadoc for ThreadLocalSessionContext state: "it unsafe for this impl to actually generate Session instances; thus it does not" but at currentSession it does the following: if (current == null) { log.debug("Current thread doesn't have a session, opening new"); bind(factory.openSession( null, Which one should it be ? btw. any reason why we can't return Session instead of classical.Session ? -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://www.jboss.com/events/jbossworld JBoss World Barcelona 10-12 October --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] ThreadLocalSessionContext javadoc inconsistency
On Mon, 03 Oct 2005 16:37:12 +0200, Steve Ebersole <[EMAIL PROTECTED]> wrote: Ah yes! Forgot that it already knows about the SF to which it is bound via its constructor. So really the only changes needed here is to the "static portion" of ThreadLocalSessionContext. Well, it's a trivial implementation. We should either include it or at the very least post it to the Wiki. If we add it to the distro, then at least I'd have more then 3 things in that new package :) I could even refactor the Synchronization into a top-level class; then I'd have 5 things in that package :)) There you go - it wasn't that bad ;) You get a package and classes just pops up from everywhere ;) /max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christian Bauer Sent: Monday, October 03, 2005 9:25 AM To: Hibernate development Subject: Re: [Hibernate] ThreadLocalSessionContext javadoc inconsistency Steve Ebersole wrote: Here's another concern with the current impl for ThreadLocalSessionContext: the static accessors. Basically the way this is setup right now, users will nt be able to use this simultaneously for multiple session-factories... Well, I'd say that this is one of the "implement your own SessionContext" cases. It would be the same but with a Map of ThreadLocals and SF name on all methods, right? --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://www.jboss.com/events/jbossworld JBoss World Barcelona 10-12 October --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] ThreadLocalSessionContext javadoc inconsistency
Ah yes! Forgot that it already knows about the SF to which it is bound via its constructor. So really the only changes needed here is to the "static portion" of ThreadLocalSessionContext. Well, it's a trivial implementation. We should either include it or at the very least post it to the Wiki. If we add it to the distro, then at least I'd have more then 3 things in that new package :) I could even refactor the Synchronization into a top-level class; then I'd have 5 things in that package :)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christian Bauer Sent: Monday, October 03, 2005 9:25 AM To: Hibernate development Subject: Re: [Hibernate] ThreadLocalSessionContext javadoc inconsistency Steve Ebersole wrote: > Here's another concern with the current impl for > ThreadLocalSessionContext: the static accessors. Basically the way > this is setup right now, users will nt be able to use this > simultaneously for multiple session-factories... Well, I'd say that this is one of the "implement your own SessionContext" cases. It would be the same but with a Map of ThreadLocals and SF name on all methods, right? --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] ThreadLocalSessionContext javadoc inconsistency
Steve Ebersole wrote: Here's another concern with the current impl for ThreadLocalSessionContext: the static accessors. Basically the way this is setup right now, users will nt be able to use this simultaneously for multiple session-factories... Well, I'd say that this is one of the "implement your own SessionContext" cases. It would be the same but with a Map of ThreadLocals and SF name on all methods, right? --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] ThreadLocalSessionContext javadoc inconsistency
On Mon, 03 Oct 2005 16:15:01 +0200, Steve Ebersole <[EMAIL PROTECTED]> wrote: Here's another concern with the current impl for ThreadLocalSessionContext: the static accessors. Basically the way this is setup right now, users will nt be able to use this simultaneously for multiple session-factories... oh - thats not nice. This becomes a global thing...would it make sense to have getCurrentSession(string name); ...hmm i guess not...it is equally "hard" to keep track of the current name as well as the current sessionfactory. bummer...i had hoped to use this in the eclipse plugin, but cant because I actually here by its nature can/will have multiple session-factories with different strategies. oh well - its still a good thing for 98% of the worlds applications ;) /max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Max Rydahl Andersen Sent: Saturday, October 01, 2005 10:32 AM To: Hibernate development Subject: [Hibernate] ThreadLocalSessionContext javadoc inconsistency hi, javadoc for ThreadLocalSessionContext state: "it unsafe for this impl to actually generate Session instances; thus it does not" but at currentSession it does the following: if (current == null) { log.debug("Current thread doesn't have a session, opening new"); bind(factory.openSession( null, Which one should it be ? btw. any reason why we can't return Session instead of classical.Session ? -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://www.jboss.com/events/jbossworld JBoss World Barcelona 10-12 October --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] ThreadLocalSessionContext javadoc inconsistency
Here's another concern with the current impl for ThreadLocalSessionContext: the static accessors. Basically the way this is setup right now, users will nt be able to use this simultaneously for multiple session-factories... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Max Rydahl Andersen Sent: Saturday, October 01, 2005 10:32 AM To: Hibernate development Subject: [Hibernate] ThreadLocalSessionContext javadoc inconsistency hi, javadoc for ThreadLocalSessionContext state: "it unsafe for this impl to actually generate Session instances; thus it does not" but at currentSession it does the following: if (current == null) { log.debug("Current thread doesn't have a session, opening new"); bind(factory.openSession( null, Which one should it be ? btw. any reason why we can't return Session instead of classical.Session ? -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://www.jboss.com/events/jbossworld JBoss World Barcelona 10-12 October --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] sweet
No it only exists in CVS at the moment with discussions on the mailing list. Mark Max Rydahl Andersen wrote: any link for that sweet project ? It seems well hidden over at their site ,) /max Haven't seen this mentioned in the Hibernate mailing lists and thought this might interest some people. Eclipse has an incubator project for Visual Editor, http://www.eclipse.org/vep/, called sweet. Its a data binding framework with examples written for Hibernate, at the moment its just the framework, they haven't started writing visual tools for it. http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ve.sweet/src/org/eclipse/ve/sweet2/hibernate/?cvsroot=Tools_Project Mark --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://www.jboss.com/events/jbossworld JBoss World Barcelona 10-12 October --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] sweet
any link for that sweet project ? It seems well hidden over at their site ,) /max Haven't seen this mentioned in the Hibernate mailing lists and thought this might interest some people. Eclipse has an incubator project for Visual Editor, http://www.eclipse.org/vep/, called sweet. Its a data binding framework with examples written for Hibernate, at the moment its just the framework, they haven't started writing visual tools for it. http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ve.sweet/src/org/eclipse/ve/sweet2/hibernate/?cvsroot=Tools_Project Mark --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://www.jboss.com/events/jbossworld JBoss World Barcelona 10-12 October --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel