title: Spring and Hibernate configuration
body: <p>Here is my hibernate config, but for some reason it fails to load those properties that I have added to <code>&lt;property name="hibernateProperties"&gt;</code> and log says in startup that <code>INFO  org.hibernate.cfg.Environment - hibernate.properties not found</code>.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
      http://www.springframework.org/schema/tx 
      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
      http://www.springframework.org/schema/aop 
      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"&gt;
  
      &lt;bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt;
          &lt;property name="driverClassName" value="org.hibernate.dialect.PostgreSQLDialect" /&gt;
          &lt;property name="url" value="jdbc:postgresql://localhost:5432/testdatabase" /&gt;
          &lt;property name="username" value="postgres" /&gt;
          &lt;property name="password" value="password" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="myDataSource" /&gt;
          &lt;property name="packagesToScan" value="org.test"/&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;value&gt;
                  hbm2ddl.auto=create
                  hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
                  hibernate.show_sql=true             
              &lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="transactionManager"
          class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>EDIT: Full log:</p>
  
  <pre><code>    2010-08-29 15:27:15,986 [main] INFO  org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.3.1.GA
      2010-08-29 15:27:15,997 [main] INFO  org.hibernate.cfg.Environment - Hibernate 3.2.6
      2010-08-29 15:27:16,000 [main] INFO  org.hibernate.cfg.Environment - hibernate.properties not found
      2010-08-29 15:27:16,002 [main] INFO  org.hibernate.cfg.Environment - Bytecode provider name : cglib
      2010-08-29 15:27:16,005 [main] INFO  org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
      2010-08-29 15:27:16,113 [main] INFO  org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: org.test.TestEntity
      2010-08-29 15:27:16,145 [main] INFO  org.hibernate.cfg.annotations.EntityBinder - Bind entity org.test.TestEntity on table TestEntity
      2010-08-29 15:27:16,188 [main] INFO  org.hibernate.cfg.AnnotationConfiguration - Hibernate Validator not found: ignoring
      2010-08-29 15:27:16,188 [main] INFO  org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean - Building new Hibernate SessionFactory
      2010-08-29 15:27:16,238 [main] INFO  org.hibernate.connection.ConnectionProviderFactory - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
      2010-08-29 15:27:16,663 [main] INFO  org.hibernate.cfg.SettingsFactory - RDBMS: PostgreSQL, version: 9.0beta4
      2010-08-29 15:27:16,664 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC3 with SSL (build 603)
      2010-08-29 15:27:16,667 [main] INFO  org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.PostgreSQLDialect
      2010-08-29 15:27:16,672 [main] INFO  org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
      2010-08-29 15:27:16,674 [main] INFO  org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      2010-08-29 15:27:16,674 [main] INFO  org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
      2010-08-29 15:27:16,674 [main] INFO  org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
      2010-08-29 15:27:16,674 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
      2010-08-29 15:27:16,674 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
      2010-08-29 15:27:16,675 [main] INFO  org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
      2010-08-29 15:27:16,675 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
      2010-08-29 15:27:16,675 [main] INFO  org.hibernate.cfg.SettingsFactory - Connection release mode: auto
      2010-08-29 15:27:16,675 [main] INFO  org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
      2010-08-29 15:27:16,675 [main] INFO  org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
      2010-08-29 15:27:16,676 [main] INFO  org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
      2010-08-29 15:27:16,676 [main] INFO  org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
      2010-08-29 15:27:16,676 [main] INFO  org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      2010-08-29 15:27:16,678 [main] INFO  org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
      2010-08-29 15:27:16,678 [main] INFO  org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
      2010-08-29 15:27:16,678 [main] INFO  org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
      2010-08-29 15:27:16,678 [main] INFO  org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
      2010-08-29 15:27:16,678 [main] INFO  org.hibernate.cfg.SettingsFactory - Query cache: disabled
      2010-08-29 15:27:16,678 [main] INFO  org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
      2010-08-29 15:27:16,678 [main] INFO  org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
      2010-08-29 15:27:16,678 [main] INFO  org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
      2010-08-29 15:27:16,683 [main] INFO  org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
      2010-08-29 15:27:16,683 [main] INFO  org.hibernate.cfg.SettingsFactory - Statistics: disabled
      2010-08-29 15:27:16,683 [main] INFO  org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
      2010-08-29 15:27:16,684 [main] INFO  org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
      2010-08-29 15:27:16,684 [main] INFO  org.hibernate.cfg.SettingsFactory - Named query checking : enabled
      2010-08-29 15:27:16,703 [main] INFO  org.hibernate.impl.SessionFactoryImpl - building session factory
      2010-08-29 15:27:16,888 [main] INFO  org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
  2010-08-29 15:27:17,096 [main] INFO  org.springframework.orm.hibernate3.HibernateTransactionManager - Using DataSource [org.apache.commons.dbcp.BasicDataSource@15b55bc] of Hibernate SessionFactory for HibernateTransactionManager
  </code></pre>