-->
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.  [ 8 posts ] 
Author Message
 Post subject: Hibernate with DB2 and WAS connection pooling
PostPosted: Mon Sep 27, 2004 11:49 am 
Newbie

Joined: Thu Jun 24, 2004 1:21 pm
Posts: 5
Location: Des Moines IA
I am using:

Hibernate version 2.1.1
WebSphere App Server (WAS) 5.0.2
DB2 Server 8.0
JDK 1.3

Hibernate is locking records in DB2 when doing selects.
It is also not reading and fetching the same number of records.
My DBA says that this is causing problems.

Is anyone using Hibernate with DB2 and WAS?

If so, can you tell me how to configure Hibernate to use WAS connection pooling and hopefully solve the above problems?

I am currently using Proxool, but I need to use WAS.

Thanks.

*****************************************
#Current hibernate.properties

hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'

hibernate.dialect net.sf.hibernate.dialect.DB2Dialect
hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver

hibernate.proxool.pool_alias pool1
hibernate.proxool.house-keeping-sleep-time 30000
hibernate.proxool.house-keeping-test-sql
hibernate.proxool.maximum-connection-count 4
hibernate.proxool.maximum-connection-lifetime 4
hibernate.proxool.simultaneous-build-throttle 2
hibernate.proxool.maximum-active-time 500
hibernate.proxool.minimum-connection-count 2
hibernate.proxool.fatal-sql-exception
hibernate.proxool.prototype-count
hibernate.proxool.statistics
hibernate.proxool.recently-started-threshold
hibernate.proxool.overload-without-refusal-lifetime

hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory
hibernate.show_sql=true
hibernate.jdbc.batch_size 100
hibernate.jdbc.use_scrollable_resultset false
hibernate.jdbc.use_streams_for_binary true
hibernate.max_fetch_depth 3
hibernate.cglib.use_reflection_optimizer false
hibernate.cache.provider_class net.sf.hibernate.cache.HashtableCacheProvider
*******************************************


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 12:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Sorry, I don't understand the question. And it doesn't particularly seem to be Hibernate-specific. It seems more like a SQL/JDBC question.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 12:58 pm 
Newbie

Joined: Thu Jun 24, 2004 1:21 pm
Posts: 5
Location: Des Moines IA
I need to know what to put in my hibernate.properties file to make hibernate use WAS connection pooling correctly.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 12:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
hibernate.connection.datasource


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 1:12 pm 
Newbie

Joined: Thu Jun 24, 2004 1:21 pm
Posts: 5
Location: Des Moines IA
What do I put after hibernate.connection.datasource?

Can I just comment out all of the proxool lines in my hibernate.properties file?

What about the lines following the proxool lines?

This is my first web app. Where can I get more info re: configuring my datasourse?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 4:09 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
1- reference guide
2- Hibernate in action
3- FAQ
4- Forum
5- Hibernate site
6- Google
7- Commercial support

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject: Our setup
PostPosted: Mon Sep 27, 2004 4:52 pm 
Newbie

Joined: Wed Jan 21, 2004 2:20 pm
Posts: 3
I have been working in an almost identical environment for the last 9 months, with none of the problems you reported. Here are the connection settings for our web app. We use the XML config file, but you should be able to switch these to the properties syntax. Hopefully this'll be enough to get you started.

Code:
<property name="hibernate.connection.datasource">jdbc/your_datasource</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</property>
<property name="hibernate.jndi.class">com.ibm.websphere.naming.WsnInitialContextFactory </property>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 29, 2004 3:57 pm 
Newbie

Joined: Thu Jun 24, 2004 1:21 pm
Posts: 5
Location: Des Moines IA
Zedd

Thanks for the help.

The JTATransactionFactory property works fine for queries, however, I get an error when I try to update records. When I try to save a User object I get this error.

ERROR Could not find UserTransaction in JNDI - 14:45:51,077 JTATransaction:135
javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment. at com.ibm.ws.naming.java.javaURLContextFactory.isNameSpaceAccessable(javaURLContextFactory.java:101)
.....


If I change the JTATransactionFactory property back to JDBCTransactionFactory, updates work fine.

Do you know how to fix the error?

Also, when Hibernate is building the Session Factory I get a line that says:
Using Hibernate built-in connection pool (not for production use!)

How do I configure Hibernate to use WAS connection pooling?

Thanks again.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.