-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: looking up SessionFactory in JNDI from two different EARs
PostPosted: Mon Aug 14, 2006 1:10 pm 
Newbie

Joined: Mon Aug 14, 2006 1:04 pm
Posts: 1
Scenario 1) The application deployed through the same EAR is able to register, look up, and instantiate Hibernate SessionFactory through JNDI.

Scenarion2) Two EARs are deployed with separate Application class loaders (default for WebSphere). The application in one EAR registers the Hibernate SessionFactory in JNDI. The other EAR is able to do the look up, however, it fails to instatiate the factory during lookup()
Context ctx = new InitialContext();
Object obj = ctx.lookup("MySessionFactory");

lookup() returns null and the following warning is issued from SessionFactoryObjectFactory:

[8/14/06 11:31:43:875 EDT] 0000002f SessionFactor W org.hibernate.impl.SessionFactoryObjectFactory getInstance Not found: 2c9097a20d0d4d8e010d0d4d94cd0000

Question: is the behavior in the second scenario by design i.e. two J2EE Applications loaded by different application loadeds are not able to register and instatiate a Hibernate SessionFactory through JNDI?
As a workaround, I placed the Hibernate library (and related libraries) into WAS_HOME/lib/ext/app which ensured that the two EARs share the same instance of Hibernate SessionFactory by being loaded by a common Extension class loader. However, cleaner solution would be to use JNDI for that purpose between multiple EARs.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 12:57 pm 
Beginner
Beginner

Joined: Tue Aug 08, 2006 11:53 am
Posts: 37
Hi can u pls post the hibernate config file u r using! I tried with the following proeprty and somehow hibernate is not able to bound the session factory to the WAS 6.0 JNDI! It is failing with the following error

<property name="hibernate.session_factory_name"> hibernate/HibernateSessionFactory </property>

Configured SessionFactory: null

Also can u pls post how r u looking up the factory form JNDI

Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.