Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread John J. Allison
> Oh, looking back at your original code, it seems like Tomcat lets you > bind a Reference to an ObjectFactory in the webapp.xml. This is > tomcat-specific stuff, by the looks. > > Oh, now I remember! Tomcat has a read-only JNDI server, doesn't it? That > is why you had trouble? Why don't you j

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread Christian Bauer
On 07 Apr (13:04), John J. Allison wrote: > Well, I'm open to suggestions, but there are alot of people using > plain old Tomcat and it'd be nice if this stuff just worked with > Tomcat & Hibernate & JNDI. Why? The only benefit would be a SessionFactory in JNDI, why do we need this exactly? It's

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread Gavin King
Oh, looking back at your original code, it seems like Tomcat lets you bind a Reference to an ObjectFactory in the webapp.xml. This is tomcat-specific stuff, by the looks. Oh, now I remember! Tomcat has a read-only JNDI server, doesn't it? That is why you had trouble? Why don't you just get a re

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread John J. Allison
> U ... as per the Hibernate documentation: > > new Configuration().configure().buildSessionFactory() > > will instantiate a SessionFactory and bind its Reference to JNDI and > register it with the ObjectFactory. > It works by calling "new SessionFactoryImpl" which calls SessionFactoryObje

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread John J. Allison
Hit the wrong reply and didn't Cc: the list on this. Of course if this is boring, somebody tell me to shut up. > Sorry, I simply do not buy that DBCP dynamically instantiates a new > datasource when you lookup against an unbound name! There is a > connection pool already configured, and a refere

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread Gavin King
Sorry, I simply do not buy that DBCP dynamically instantiates a new datasource when you lookup against an unbound name! There is a connection pool already configured, and a reference already bound to JNDI. Clearly. AFAIK, the correct behavior if I attempt to lookup() an unbound name is always

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread Gavin King
U ... as per the Hibernate documentation: new Configuration().configure().buildSessionFactory() will instantiate a SessionFactory and bind its Reference to JNDI and register it with the ObjectFactory. Who else but SessionFactoryObjectFactory, which implements ObjectFactory? Who else is doin

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread Gavin King
I'm afraid that I have to say your reading of the JNDI spec is mistaken. Keep reading further down into that JavaDoc, where it makes quite clear that the ObjectFactory is responsible for creating objects for References that were /already bound to a name/, ie. exactly how Hibernate is doing it now.

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread John J. Allison
> I'm afraid that I have to say your reading of the JNDI spec is mistaken. Fair enough, could be. > Keep > reading further down into that JavaDoc, where it makes quite clear that the > ObjectFactory is responsible for creating objects for References that were > /already bound to a name/, ie. exac

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread John J. Allison
> Please note that this new code module added added as a part of Middlegen > 2.1 we are working on at the moment. Its an improvement on the old demo > application that had an EJB backend that we have supplied with previous > versions of the tool. Since this is only in CVS it is likely to not be

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread John J. Allison
> This is absolutely correct behavior. SessionFactoryObjectFactory is > meant to return already-bound session factories. > > John J. Allison wrote: > > >Poking around, I noticed that SessionFactoryObjectFactory never > >actually creates a SessionFactory. When getObjectInstance() is > >called, th

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread Gavin King
This is absolutely correct behavior. SessionFactoryObjectFactory is meant to return already-bound session factories. John J. Allison wrote: Poking around, I noticed that SessionFactoryObjectFactory never actually creates a SessionFactory. When getObjectInstance() is called, that's what Tomcat ex

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-07 Thread David Channon
> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, April 07, 2004 9:34 AM Subject: Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI) > > How about giving us a hint what was wrong with the existing > > implementation. No-one else has ever compl

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-06 Thread John J. Allison
> How about giving us a hint what was wrong with the existing > implementation. No-one else has ever complained. Sure, sorry. The code generated by Middlegen is doing this: net.sf.hibernate.SessionFactory factory = (net.sf.hibernate.SessionFactory)ctx.lookup("java:comp/env/AirlineHibernateFac

Re: [Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-06 Thread Gavin King
How about giving us a hint what was wrong with the existing implementation. No-one else has ever complained. John J. Allison wrote: In the process of getting Middlegen's airline sample to work (sort of, except for Struts), I developed a new SessionFactoryObjectFactory which actually works with T

[Hibernate] SessionFactoryObjectFactory (Tomcat & JNDI)

2004-04-06 Thread John J. Allison
In the process of getting Middlegen's airline sample to work (sort of, except for Struts), I developed a new SessionFactoryObjectFactory which actually works with Tomcat's JNDI resources. None of the stuff in the docs or found from google were satisfactory, e.g. http://www.hibernate.org/114.html ht