> From: Raible, Matt [mailto:[EMAIL PROTECTED]
> 
> BTW - your filter complains about setting a static variable
> from a non-static context: this.factory =
> (SessionFactory)ctx.lookup(factoryJndiName);

Right - that's deliberate.  You don't want to create a new
InitialContext and perform a JNDI lookup for the factory every time you
obtain a new session.  It is potentially an expensive operation.  init()
is a great place to do it.

Alternatively you could cache the factory in a static the first time you
obtain it.  However, that would technically require synchronization to
be thread-safe.

Jeff


-------------------------------------------------------
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