Yes, it is possible. Something like this should do the trick:

factory = new Configuration("/hibernate.cfg.xml").configure()[0];

Joe

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Jason Carreira
> Sent: Wednesday, February 05, 2003 12:13 PM
> To: [EMAIL PROTECTED]
> Subject: [Hibernate] Hibernate.cfg.xml without JNDI
> 
> 
> Is it possible to use hibernate.cfg.xml without JNDI? It 
> would even be enough if Hibernate.configure() would return 
> the SessionFactory in addition to binding it to the JNDI 
> context, or make it optional.
> 
> The reason is, I'm trying to implement Junit tests that only 
> depend upon getting a database connection, without a 
> container (=JNDI provider) running. I tried using Mock 
> objects, but their MockContext doesn't seem to actually store 
> the bound objects for lookup later. I don't really want to 
> have to implement my own in-memory Context, so I'm wondering 
> why this form of configuration, by far the easiest, is so 
> limited in what it can do?
> 
> Thanks, 
> 
> Jason Carreira
> 
> --
> Jason Carreira
> Software Architect, Notiva Corp.
> phone:        585.240.2793
>   fax:        585.272.8118
> email:        [EMAIL PROTECTED]
> ---
> Notiva - optimizing trade relationships (tm)
>  
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld =omething 2 
> See! http://www.vasoftware.com 
> _______________________________________________
> hibernate-devel mailing list [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> 
> 




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Reply via email to