-->
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: JNDI based connection pooling
PostPosted: Tue Oct 24, 2006 11:22 am 
Newbie

Joined: Tue Oct 24, 2006 11:08 am
Posts: 1
Hibernate version 3.2
I am trying to use jndi based connection pooling for Websphere 6.1 application server and use the jndi url in hibernate config to access the database.

I configured these properties
<property name="hibernate.connection.datasource">jdbc/myapp</property>
<property name="hibernate.jndi.class">com.ibm.websphere.naming.WsnInitialContextFactory</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
<property name="hibernate.jndi.url">iiop://localhost:2810/</property>
<property name="current_session_context_class">thread</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

I configured datasource/jdbc provider in application deployment descriptor. I have two questions here...
1. If I do not provide connection.username and connection.password in hibernate.config.xml file, which I do not want to do, i am not able to get a database connection. I configured these in datasource properties to fetch values from JAAS.
http://www.hibernate.org/hib_docs/refer ... ation.html
Table 3.2 in that document says that both username and password are optional..


2. When I configure JDBC provider, I have to provide implementation class name as com.mysql.jdbc.Driver for it to work rather than com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource..

Thanks!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 12:18 pm 
Regular
Regular

Joined: Wed Jul 27, 2005 2:33 am
Posts: 118
Quote:
<property name="hibernate.connection.datasource">jdbc/myapp</property>


Shouldn't this(and the other properties) be:

Code:
<property name="connection.datasource">jdbc/myapp</property>


Have a look at Section 3.8. XML Configuration File at:

http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html

for more details.


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.