-->
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: Hibernate's default connection provider
PostPosted: Fri Jul 22, 2005 6:21 pm 
Newbie

Joined: Wed Mar 09, 2005 12:36 am
Posts: 12
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Name and version of the database you are using: N/A




Quick question....more of a sanity check really. I just started a new gig a little over a week ago. I've been plowing through the code, and wanted to triple check with you folks here (I've read the FAQ, the PDF and the book...got the same answer from all 3, but want to verify).

This project is using Hibernate without Spring (meaning no handy LocalSessionFactoryBean wired up in an app context), so they are building their SessionFactory manually in code from the Configuration. hibernate.cfg.xml lives on the classpath and has all the SessionFactory settings defined in it.

"hibernate.connection.provider_class" is not set and neither is "hibernate.connection.datasource"

A quote from the book says..."Specifying properties of the form hibernate.c3p0.* selects C3P0 as Hibernate's connection pool (you don't need any other switch to enable C3P0 support)."

Can someone please verify for me that the same is true for "hibernate.dbcp.*", or has this project been using the default connection pool, the one that is not supposed to be used in production, all along?

Code:
<hibernate-configuration>
   <session-factory>
      <property name="show_sql">false</property>
      <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>

      <property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
      <property name="connection.url">jdbc:jtds:sqlserver://localhost/storagemanager;SelectMethod=cursor</property>
      <property name="connection.username">crosswalkapp</property>
      <property name="connection.password">crosswalkapp</property>
      <property name="connection.isolation">2</property>
      <property name="dbcp.maxActive">20</property>
      <property name="dbcp.whenExhaustedAction">1</property>
      <property name="dbcp.maxWait">120000</property>
      <property name="dbcp.maxIdle">10</property>
      <property name="dbcp.ps.maxActive">20</property>
      <property name="dbcp.ps.whenExhaustedAction">1</property>
      <property name="dbcp.ps.maxWait">120000</property>
      <property name="dbcp.ps.maxIdle">10</property>

      <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
      <property name="hibernate.query.substitutions">true 'Y', false 'N'</property>
      <property name="hibernate.max_fetch_depth ">3</property>
      <property name="hibernate.jdbc.batch_size">25</property>
      <property name="jdbc.use_scrollable_resultset">false</property>
      <property name="hibernate.default_batch_fetch_size">8</property>
      <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
   <!--
      <property name="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
-->
      <property name="hibernate.cache.use_query_cache">true</property>

      <!-- Mapping files -->

   </session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject: some clarificaton
PostPosted: Fri Jul 22, 2005 6:42 pm 
Newbie

Joined: Wed Mar 09, 2005 12:36 am
Posts: 12
I looked a little more.

From the v2.x API docs - http://www.hibernate.org/hib_docs/api/n ... vider.html

"A connection provider that uses an Apache commons DBCP connection pool. Hibernate will use this by default if the hibernate.dbcp.* properties are set."

Does the same still hold true for version 3? I wonder, because DBCPConnectionProvider does not exist in the version 3 jar...


Top
 Profile  
 
 Post subject: solution
PostPosted: Fri Jul 22, 2005 6:51 pm 
Newbie

Joined: Wed Mar 09, 2005 12:36 am
Posts: 12
I should've kept looking. Sorry for cluttering the board with answers to my own question. Hopefully someone else can find use of this sometime.

The log spits this out when you start Tomcat.

org.hibernate.connection.DriverManagerConnectionProvider 2005-07-22 16:47:42,377 -- INFO -- Using Hibernate built-in connection pool (not for production use!)


This is scary because this thing is on version 3.0 and has been in production for awhile now.


Top
 Profile  
 
 Post subject: Re: Hibernate's default connection provider
PostPosted: Tue Jul 30, 2013 1:07 am 
Newbie

Joined: Tue Jul 30, 2013 12:40 am
Posts: 1
This is useful, give me the clear way to identify default connection provider

Seems we are using DriverManagerConnectionProvider also, as many things changed these years, it is better to re-determine whether DriverManagerConnectionProvider is proper for production usage.


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.