-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate reads configuration multiple times for one request
PostPosted: Sun Sep 25, 2011 8:05 am 
Newbie

Joined: Sun Sep 25, 2011 7:50 am
Posts: 1
Hi all,

I'm quite new to Hibernate and have a strange problem. I've configured my Hibernate like in the tutorial of the core reference. Every time I get an Object from my database, my server log shows the Hibernate configuration multiple times. Is this normal or did I configured something wrong?

Here is my hibernate.cfg.xml:
Code:
<hibernate-configuration>
  <session-factory>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">xx</property>
    <property name="hibernate.connection.username">xx</property>
    <property name="hibernate.connection.password">xx</property>
    <property name="connection.pool_size">1</property>
    <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
    <property name="show_sql">true</property>
    <property name="hibernate.current_session_context_class">thread</property>
    <mapping ... />
  </session-factory>
</hibernate-configuration>


And here the output from the server log reduced from about 5-6 times to one:
Code:
INFO: Hibernate: select ... from ...
INFO: configuring from resource: /hibernate.cfg.xml
INFO: Configuration resource: /hibernate.cfg.xml
INFO: Reading mappings from resource : ...
INFO: Configured SessionFactory: null
INFO: Mapping class: ...
INFO: Hibernate Validator not found: ignoring
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
INFO: Using Hibernate built-in connection pool (not for production use!)
INFO: Hibernate connection pool size: 1
INFO: autocommit mode: false
INFO: using driver: com.mysql.jdbc.Driver at URL: ...
INFO: connection properties: {user=xx, password=****}
INFO: Using dialect: org.hibernate.dialect.MySQLDialect
INFO: Database ->
       name : MySQL
    version : 5.1.53
      major : 5
      minor : 1
INFO: Driver ->
       name : MySQL-AB JDBC Driver
    version : mysql-connector-java-5.1.15 ( Revision: ${bzr.revision-id} )
      major : 5
      minor : 1
INFO: Using default transaction strategy (direct JDBC transactions)
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
INFO: Automatic flush during beforeCompletion(): disabled
INFO: Automatic session close at end of transaction: disabled
INFO: JDBC batch size: 15
INFO: JDBC batch updates for versioned data: disabled
INFO: Scrollable result sets: enabled
INFO: JDBC3 getGeneratedKeys(): enabled
INFO: Connection release mode: auto
INFO: Maximum outer join fetch depth: 2
INFO: Default batch fetch size: 1
INFO: Generate SQL with comments: disabled
INFO: Order SQL updates by primary key: disabled
INFO: Order SQL inserts for batching: disabled
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO: Using ASTQueryTranslatorFactory
INFO: Query language substitutions: {}
INFO: JPA-QL strict compliance: disabled
INFO: Second-level cache: enabled
INFO: Query cache: disabled
INFO: Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
INFO: Optimize cache for minimal puts: disabled
INFO: Structured second-level cache entries: disabled
INFO: Echoing all SQL to stdout
INFO: Statistics: disabled
INFO: Deleted entity synthetic identifier rollback: disabled
INFO: Default entity-mode: pojo
INFO: Named query checking : enabled
INFO: Check Nullability in Core (should be disabled when Bean Validation is on): disabled
INFO: building session factory
INFO: Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@86d3b3
INFO: Type registration [blob] overrides previous : org.hibernate.type.BlobType@1b4aee4
INFO: Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@1b4aee4
INFO: Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@1bf4c1a
INFO: Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@1d5045
INFO: Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@80ed5a
INFO: Type registration [clob] overrides previous : org.hibernate.type.ClobType@d01e76
INFO: Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@d01e76
INFO: Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@17ff73e
INFO: Not binding factory to JNDI, no JNDI name configured


I'm using Hibernate 3.6.3 with JDK 1.6.0_25 and Glassfish 3.1.

Thanks for your help.

BR, Gerry


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.