-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernarte + EHcache
PostPosted: Thu Jul 22, 2010 10:03 am 
Newbie

Joined: Mon Jul 12, 2010 7:06 am
Posts: 6
Hi, i am trying to use second level cache, everything seems to work perfectly, but the second level cache is never activated (according to logs)...I think, that I have something somewhere missconfigured, but I cant find it...

Versions
Code:
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.5.3</version>
        </dependency>
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache</artifactId>
            <version>2.1.1</version>
            <type>pom</type>
        </dependency>

Session factory bean in Spring
Code:
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="annotatedClasses">
            <list>
                <value>cz.flexibla.common.bo.AbstractBusinessObject</value>
                <value>cz.flexibla.common.bo.ArticleRanking</value>
                <value>cz.flexibla.common.bo.CascadingStyleSheet</value>
                <value>cz.flexibla.common.bo.ReadCount</value>
                <value>cz.flexibla.common.bo.Article</value>
                <value>cz.flexibla.common.bo.ArticleDetails</value>
                <value>cz.flexibla.common.bo.LatexImage</value>
                <value>cz.flexibla.common.bo.NamedEntry</value>
                <value>cz.flexibla.common.bo.Template</value>
                <value>cz.flexibla.common.bo.Article</value>
                <value>cz.flexibla.common.bo.ArticleDetails</value>
                <value>cz.flexibla.common.bo.LanguageMutation</value>
                <value>cz.flexibla.common.bo.Category</value>
                <value>cz.flexibla.common.bo.ArticleCategory</value>
                <value>cz.flexibla.common.bo.CategorySubCategory</value>
            </list>
        </property>
        <property name="mappingResources">
            <list>
                <value>cz/flexibla/common/bo/user.hbm.xml</value>
                <value>cz/flexibla/common/bo/comment.hbm.xml</value>
                <value>cz/flexibla/common/bo/attachment.hbm.xml</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
               
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.cache">true</prop>

                <prop key="hibernate.c3p0.min_size">5</prop>
                <prop key="hibernate.c3p0.idle_test_period">100</prop> <!-- seconds -->
                <prop key="hibernate.c3p0.timeout">150</prop> <!-- seconds -->
                <prop key="hibernate.c3p0.hibernate.c3p0.max_statements">10</prop>

                <prop key="hibernate.hbm2ddl.auto">update</prop>
                <prop key="hibernate.current_session_context_class">thread</prop>
                <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop>
                <prop key="hibernate.connection.release_mode">on_close</prop>
                <prop key="hibernate.transaction.auto_close_session">false</prop>

                <prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop>
                <prop key="hibernate.search.default.indexBase">${hibernate.lucene.indexBase}</prop>

                <prop key="hibernate.cache.use_second_level_cache">true</prop>
                <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory</prop>
                <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>
                <prop key="hibernate.cache.use_query_cache">true</prop>
                <prop key="net.sf.ehcache.configurationResourceName">ehcache.xml</prop>

                 <prop key="hibernate.generate_statistics">true</prop>
            </props>
        </property>
    </bean>


src/ehcache.xml
Code:
<ehcache>
    <diskStore path="java.io.tmpdir"/>

    <defaultCache
        maxElementsInMemory="10000"
        eternal="false"
        timeToIdleSeconds="120"
        timeToLiveSeconds="120"
        overflowToDisk="false"
        maxElementsOnDisk="10000000"
        diskPersistent="false"
        diskExpiryThreadIntervalSeconds="120"
        memoryStoreEvictionPolicy="LRU"
        />

    <cache name="cz.flexibla.common.bo.Article"
           maxElementsInMemory="300"
           timeToIdleSeconds="300"
           timeToLiveSeconds="600"
           eternal="false"
           overflowToDisk="false"
           diskPersistent="false"
           diskExpiryThreadIntervalSeconds="120"
           memoryStoreEvictionPolicy="LRU"
           />
    <cache name="cz.flexibla.common.bo.Category"
           maxElementsInMemory="300"
           timeToIdleSeconds="300"
           timeToLiveSeconds="600"
           eternal="false"
           overflowToDisk="false"
           diskPersistent="false"
           diskExpiryThreadIntervalSeconds="120"
           memoryStoreEvictionPolicy="LRU"
           />
    <cache name="cz.flexibla.common.bo.ArticleCategory"
           maxElementsInMemory="300"
           timeToIdleSeconds="300"
           timeToLiveSeconds="600"
           eternal="false"
           overflowToDisk="false"
           diskPersistent="false"
           diskExpiryThreadIntervalSeconds="120"
           memoryStoreEvictionPolicy="LRU"
           />
    <cache name="cz.flexibla.common.bo.CategorySubCategory"
           maxElementsInMemory="300"
           timeToIdleSeconds="300"
           timeToLiveSeconds="600"
           eternal="false"
           overflowToDisk="false"
           diskPersistent="false"
           diskExpiryThreadIntervalSeconds="120"
           memoryStoreEvictionPolicy="LRU"
           />
    <cache name="cz.flexibla.common.bo.Category.subCategories"
           maxElementsInMemory="300"
           timeToIdleSeconds="300"
           timeToLiveSeconds="600"
           eternal="false"
           overflowToDisk="false"
           diskPersistent="false"
           diskExpiryThreadIntervalSeconds="120"
           memoryStoreEvictionPolicy="LRU"
           />
    <cache name="cz.flexibla.common.bo.Category.articleCategories"
           maxElementsInMemory="300"
           timeToIdleSeconds="300"
           timeToLiveSeconds="600"
           eternal="false"
           overflowToDisk="false"
           diskPersistent="false"
           diskExpiryThreadIntervalSeconds="120"
           memoryStoreEvictionPolicy="LRU"
           />
    <cache name="cz.flexibla.common.bo.LanguageMutation"
           maxElementsInMemory="300"
           timeToIdleSeconds="300"
           timeToLiveSeconds="600"
           eternal="false"
           overflowToDisk="false"
           diskPersistent="false"
           diskExpiryThreadIntervalSeconds="120"
           memoryStoreEvictionPolicy="LRU"
           />
    <cache
        name="org.hibernate.cache.StandardQueryCache"
        maxElementsInMemory="50"
        eternal="false"
        timeToLiveSeconds="120"
        overflowToDisk="false"/>
</ehcache>


one of the entities
Code:
@Entity
@Cacheable
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Category extends AbstractBusinessObject {
    private static final long serialVersionUID = 1L;
    @Column
    private String name;

    @OneToOne(mappedBy="subCategory", cascade=CascadeType.ALL)
    @Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
    private CategorySubCategory parentCategory;

    @OneToMany(cascade=CascadeType.ALL, mappedBy="category", orphanRemoval=true)
    @OrderBy("priority DESC")
    @Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
    private List<CategorySubCategory> subCategories;

    @OneToMany(cascade=CascadeType.ALL, mappedBy="category", orphanRemoval=true)
    @OrderBy("priority DESC")
    @Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
    private List<ArticleCategory> articleCategories;

    @ManyToOne
    private Template template;

getters and setters here
.
.
.


src/log4j.properties
Code:
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

### set log levels - for more verbose logging change 'info' to 'debug' ###

log4j.rootLogger=debug, stdout

#log4j.logger.org.hibernate=info
log4j.logger.org.hibernate=debug
log4j.logger.org.springframework=info

### log HQL query parser activity
#log4j.logger.org.hibernate.hql.ast.AST=debug

### log just the SQL
log4j.logger.org.hibernate.SQL=debug


### log JDBC bind parameters ###
log4j.logger.org.hibernate.type=info

### log schema export/update ###
log4j.logger.org.hibernate.tool.hbm2ddl=info

### log HQL parse trees
log4j.logger.org.hibernate.hql=debug

### log cache activity ###
log4j.logger.org.hibernate.cache=debug

### log transaction activity
log4j.logger.org.hibernate.transaction=debug

### log JDBC resource acquisition
#log4j.logger.org.hibernate.jdbc=debug

### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace



LOG OUTPUT
Code:
JRebel: Reinitialized class 'cz.flexibla.common.bo.LanguageMutation_$$_javassist_15'.
22.7.2010 15:58:54 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: cz.flexibla.common.bo.User -> users
22.7.2010 15:58:54 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: cz.flexibla.common.bo.Comment -> Comment
22.7.2010 15:58:54 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: cz.flexibla.common.bo.Attachment -> Attachment
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.AbstractBusinessObject
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.AbstractBusinessObject on table AbstractBusinessObject
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.ArticleRanking
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.ArticleRanking on table ArticleRanking
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.CascadingStyleSheet
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.CascadingStyleSheet on table CascadingStyleSheet
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.ReadCount
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.ReadCount on table ReadCount
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.Article
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.Article on table Article
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.ArticleDetails
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.ArticleDetails on table ArticleDetails
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.LatexImage
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.LatexImage on table LatexImage
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.NamedEntry
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.NamedEntry on table NamedEntry
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.Template
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.Template on table Template
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.Category
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.Category on table Category
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.LanguageMutation
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.LanguageMutation on table LanguageMutation
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.ArticleCategory
22.7.2010 15:58:54 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.ArticleCategory on table ArticleCategory
22.7.2010 15:58:54 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: cz.flexibla.common.bo.CategorySubCategory
22.7.2010 15:58:55 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity cz.flexibla.common.bo.CategorySubCategory on table CategorySubCategory
22.7.2010 15:58:55 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
INFO: Mapping collection: cz.flexibla.common.bo.Article.articleCategories -> ArticleCategory
22.7.2010 15:58:55 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
INFO: Mapping collection: cz.flexibla.common.bo.Article.attachments -> Attachment
22.7.2010 15:58:55 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
INFO: Mapping collection: cz.flexibla.common.bo.Article.comments -> Comment
22.7.2010 15:58:55 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
INFO: Mapping collection: cz.flexibla.common.bo.Template.articles -> ArticleDetails
22.7.2010 15:58:55 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
INFO: Mapping collection: cz.flexibla.common.bo.Template.categories -> Category
22.7.2010 15:58:55 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
INFO: Mapping collection: cz.flexibla.common.bo.Category.articleCategories -> ArticleCategory
22.7.2010 15:58:55 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
INFO: Mapping collection: cz.flexibla.common.bo.Category.subCategories -> CategorySubCategory
22.7.2010 15:58:55 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
INFO: Mapping collection: cz.flexibla.common.bo.LanguageMutation.articlesInMutation -> Article
15:58:55,374  INFO AnnotationSessionFactoryBean:730 - Building new Hibernate SessionFactory
22.7.2010 15:58:55 org.hibernate.cfg.AnnotationConfiguration applyHibernateValidatorLegacyConstraintsOnDDL
INFO: Hibernate Validator not found: ignoring
22.7.2010 15:58:55 org.hibernate.connection.ConnectionProviderFactory newConnectionProvider
INFO: Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
22.7.2010 15:58:55 org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: PostgreSQL, version: 8.4.0
22.7.2010 15:58:55 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.4 JDBC4 (build 701)
22.7.2010 15:58:55 org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.PostgreSQLDialect
22.7.2010 15:58:55 org.hibernate.engine.jdbc.JdbcSupportLoader useContextualLobCreation
INFO: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
22.7.2010 15:58:55 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
22.7.2010 15:58:55 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
22.7.2010 15:58:55 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): enabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: on_close
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL inserts for batching: disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
22.7.2010 15:58:56 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: enabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory createRegionFactory
INFO: Cache region factory : net.sf.ehcache.hibernate.EhCacheRegionFactory
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: enabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory createQueryCacheFactory
INFO: Query cache factory: org.hibernate.cache.StandardQueryCacheFactory
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
22.7.2010 15:58:56 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Check Nullability in Core (should be disabled when Bean Validation is on): enabled
22.7.2010 15:58:56 org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
22.7.2010 15:58:56 net.sf.ehcache.hibernate.AbstractEhcacheRegionFactory getOnePhaseCommitSyncTransactionManager
WARNING: No TransactionManagerLookup found in Hibernate config, XA Caches will be participating in the two-phase commit!
22.7.2010 15:58:56 net.sf.ehcache.CacheManager detectAndFixDiskStorePathConflict
WARNING: Creating a new instance of CacheManager using the diskStorePath "C:\Users\malejpavouk\Stuff\vyvoj\apache-tomcat-6.0.20\temp" which is already used by an existing CacheManager.
The source of the configuration was net.sf.ehcache.config.generator.ConfigurationSource$URLConfigurationSource@f7dab3.
The diskStore path for this CacheManager will be set to C:\Users\malejpavouk\Stuff\vyvoj\apache-tomcat-6.0.20\temp\ehcache_auto_created_1279807136783.
To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.
22.7.2010 15:58:57 org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: Running hbm2ddl schema update
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: fetching database metadata
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: updating schema
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.article
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, mutation_id, details, menuheading, identifier]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk379164d6efc51840, fk379164d6560255dc]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [article_pkey, article_identifier_key]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.articlecategory
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, article_id, priority, category_id]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk_category, fkc9ff4ff4580a568c]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [fki_category, articlecategory_pkey]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.articledetails
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [template, id, article_id, text, articleuntransformed]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fkdf23288c242b1aa2, article_id]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [fki_article_id, articledetails_pkey]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.articleranking
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, article, address, ranking]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fkbc970280228e2a7e]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [articleranking_pkey]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.attachment
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, bytes, article, filename]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk1c93543228e2a7e]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [attachment_pkey]
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.cascadingstylesheet
22.7.2010 15:58:57 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, style, name, active]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: []
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [cascadingstylesheet_pkey]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.category
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, name, template_id]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk6dd211edc6ae928]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [category_pkey]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.categorysubcategory
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [subcategory_id, id, priority, category_id]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: []
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [categorysubcategory_subcategory_id_key, categorysubcategory_pkey]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.comment
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, stamp, article, address, name, comment]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk9bde863f228e2a7e]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [comment_pkey]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.languagemutation
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, isdefault, description, name, template_id, titlepage_id]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk6dd211edc6ae928f64cf641, fkf64cf641e69938fb]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [languagemutation_pkey]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.lateximage
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, article, dataarray]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk75969e09228e2a7e]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [lateximage_pkey]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.namedentry
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, name, entry]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: []
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [namedentry_pkey, namedentry_name_key]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.readcount
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, article, count]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk3387b4f9228e2a7e]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [readcount_pkey]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.template
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [template, id, stamp, isdefault, name]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: []
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [template_pkey]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: public.users
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, username, seed, password]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: []
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [users_username_key, users_pkey]
22.7.2010 15:58:58 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: schema update complete
22.7.2010 15:58:58 org.hibernate.cache.UpdateTimestampsCache <init>
INFO: starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache
22.7.2010 15:58:58 net.sf.ehcache.hibernate.AbstractEhcacheRegionFactory getCache
WARNING: Couldn't find a specific ehcache configuration for cache named [org.hibernate.cache.UpdateTimestampsCache]; using defaults.
22.7.2010 15:58:58 org.hibernate.cache.StandardQueryCache <init>
INFO: starting query cache at region: org.hibernate.cache.StandardQueryCache
22.7.2010 15:59:05 net.sf.ehcache.util.UpdateChecker doCheck
INFO: New update(s) found: 2.2.0 [http://ehcache.org/news.html]. Please check http://ehcache.org for the latest version.
Hibernate: select languagemu0_.id as id99_, languagemu0_.name as name108_, languagemu0_.template_id as template2_108_, languagemu0_.description as descript1_109_, languagemu0_.isDefault as isDefault109_, languagemu0_.titlePage_id as titlePage3_109_ from LanguageMutation languagemu0_ where languagemu0_.isDefault=?
Hibernate: select categorysu0_.id as id99_7_, categorysu0_.category_id as category2_111_7_, categorysu0_.priority as priority111_7_, categorysu0_.subCategory_id as subCateg3_111_7_, category1_.id as id99_0_, category1_.name as name108_0_, category1_.template_id as template2_108_0_, category1_.description as descript1_109_0_, category1_.isDefault as isDefault109_0_, category1_.titlePage_id as titlePage3_109_0_, category1_.clazz_ as clazz_0_, template2_.id as id99_1_, template2_.isDefault as isDefault107_1_, template2_.name as name107_1_, template2_.stamp as stamp107_1_, template2_.template as template107_1_, categorysu3_.id as id99_2_, categorysu3_.category_id as category2_111_2_, categorysu3_.priority as priority111_2_, categorysu3_.subCategory_id as subCateg3_111_2_, article4_.id as id99_3_, article4_.details as details103_3_, article4_.identifier as identifier103_3_, article4_.menuHeading as menuHead2_103_3_, article4_.mutation_id as mutation4_103_3_, languagemu5_.id as id99_4_, languagemu5_.name as name108_4_, languagemu5_.template_id as template2_108_4_, languagemu5_.description as descript1_109_4_, languagemu5_.isDefault as isDefault109_4_, languagemu5_.titlePage_id as titlePage3_109_4_, template6_.id as id99_5_, template6_.isDefault as isDefault107_5_, template6_.name as name107_5_, template6_.stamp as stamp107_5_, template6_.template as template107_5_, article7_.id as id99_6_, article7_.details as details103_6_, article7_.identifier as identifier103_6_, article7_.menuHeading as menuHead2_103_6_, article7_.mutation_id as mutation4_103_6_ from CategorySubCategory categorysu0_ inner join ( select id, name, template_id, null::varchar as description, null::bool as isDefault, null::int8 as titlePage_id, 9 as clazz_ from Category union all select id, name, template_id, description, isDefault, titlePage_id, 10 as clazz_ from LanguageMutation ) category1_ on categorysu0_.category_id=category1_.id left outer join


...and few more hundred of selects here...but nothing related to the second level cache...

From the code:
Code:
                log.info("Statistics: \n"
                        + "Second level cache put count: " + sessionFactory.getStatistics().getSecondLevelCachePutCount() + "\n"
                        + "Second level cache hit count: " + sessionFactory.getStatistics().getSecondLevelCacheHitCount());

I get always 0, 0

Thanks for your advise


Top
 Profile  
 
 Post subject: Re: Hibernarte + EHcache
PostPosted: Thu Jul 22, 2010 10:30 am 
Newbie

Joined: Mon Jul 12, 2010 7:06 am
Posts: 6
Partially resolved (by cleaning and restarting everything.... :-))....the second level cache works now...but the logging still shows no activity...probably something misconfigured in log4j or sessionfactory....but what...


Top
 Profile  
 
 Post subject: Re: Hibernarte + EHcache
PostPosted: Thu Jul 22, 2010 1:22 pm 
Newbie

Joined: Mon Jul 12, 2010 7:06 am
Posts: 6
Another issue regarding this topic I havent been able to solve...


If I navigate the association, the navigated object does not get associated with the session cache (according to the documentation it will only if update, save, get atc. methods are called)... so my question is how to associate this object with the second level cache...(i have plenty of association objects, which it does not make sense to load them explicitly, but I need them cached because of perfomance)

Thanks.


edit: solved: the problem: I had an AbstractBusinessObject, an abstract class from which all the other business objects inherited ID and other common things, I changed it from Entity (with inheritance annitation) to mapped superclass.


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