-->
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: GlassFish connectionPool
PostPosted: Mon Aug 23, 2010 8:05 am 
Newbie

Joined: Sun Apr 18, 2010 1:08 am
Posts: 6
Please can someone tell me how to make my hibernate enabled application connect to a database through glassfish *connectionpool* that i have already configured in glassfish. Please note that Connectionpool was tested and working fine with other deployed applications.

Should my application be deployed to glassfish server in order for hibernate to use connectionpool in glassfish!

Thank you.


Top
 Profile  
 
 Post subject: Re: GlassFish connectionPool
PostPosted: Tue Aug 24, 2010 2:56 pm 
Newbie

Joined: Sun Apr 18, 2010 1:08 am
Posts: 6
As per hibernate documentation page 47

3.8.2 JNDI-bound SessionFactory:

If you wish to have the SessionFactory bound to a JNDI namespace, specify a name (e.g.
java:hibernate/SessionFactory) using the property hibernate.session_factory_name

When binding the SessionFactory to JNDI, Hibernate will use the values of
hibernate.jndi.url, hibernate.jndi.class to instantiate an initial context. If they are not
specified, the default InitialContext will be used.

Hibernate will automatically place the SessionFactory in JNDI after you call
cfg.buildSessionFactory(). This means you will have this call in some startup code, or utility
class in your application, unless you use JMX deployment with the HibernateService (this is
discussed later in greater detail).

No where does it mention that i have to instantiate InitialContext() in my code, hibernate does all that for me!
anyone!


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.