-->
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.  [ 4 posts ] 
Author Message
 Post subject: Connection Pooling
PostPosted: Sun Sep 09, 2007 6:16 pm 
Newbie

Joined: Tue Aug 28, 2007 2:09 pm
Posts: 9
Hi,

I want to configure connection pooling with Hibernate. Which are the options available? How to configure?

Thanks.


Top
 Profile  
 
 Post subject: Re: Connection Pooling
PostPosted: Mon Sep 10, 2007 3:38 am 
Beginner
Beginner

Joined: Sat May 12, 2007 2:55 am
Posts: 24
c_java wrote:
Hi,

I want to configure connection pooling with Hibernate. Which are the options available? How to configure?

Thanks.



use c3po. a simple to use mechanism
put lines like below in hibernate.cfg.xml and put the .jar and its done
following is a typical line of code.

hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql://localhost/mydatabase
hibernate.connection.username = myuser
hibernate.connection.password = secret
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statements=50
hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect

if it helps, dont forget to rate!


Top
 Profile  
 
 Post subject: Re: Connection Pooling
PostPosted: Mon Sep 10, 2007 12:39 pm 
Newbie

Joined: Tue Aug 28, 2007 2:09 pm
Posts: 9
I am using Weblogic, so do i need to create a connection pool in weblogic and add those properties in Hibernate.cfg.xml? or i need to simply add the JDBC properties?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 10, 2007 1:17 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
You will need to set hibernate.connection.datasource property. For further reference look at hibernate documentation section 3.3. JDBC connections.


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