-->
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.  [ 1 post ] 
Author Message
 Post subject: JNDI access to a SAR in JBoss
PostPosted: Mon Nov 03, 2003 1:06 pm 
Newbie

Joined: Mon Nov 03, 2003 12:33 pm
Posts: 1
Location: Portugal
I'm a newbie in JNDI and Hibernate and I'm using Jboss.
I have a SAR file and i would like to access it by JNDI. My main questions at this point are:

1. I'm using the following code to create an initial context:

Code:
Hashtable environment = new Hashtable();
environment.put( Context.INITIAL_CONTEXT_FACTORY, jndiFactoryClass );
environment.put( Context.PROVIDER_URL, jndiURL );
initCtx = new InitialContext( environment );

Still, i don't know what should be my INITIAL_CONTEXT_FACTORY and PROVIDER_URL. And should these lines be in the class referenced by the INITIAL_CONTEXT_FACTORY?


2. I would also like to know a method for a client to obtain a session, without creating a new one. I think that the following will do that, but is this the best way to achieve it?

Code:
Context ctx = new InitialContext();
SessionFactory factory = (SessionFactory) ctx.lookup "java:/hibernate/HibernateFactory");
sess = factory.openSession();



Thanks very much for your time. Any valuable reference would be very appreciated...

_________________
________________
Lu


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

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.