-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate with encache
PostPosted: Tue May 02, 2006 3:00 am 
Newbie

Joined: Tue May 02, 2006 2:46 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Hibernate 3.1


When ever i connect with the database, hibernate initialize sessionFactory every times. can you tell me that i initialize it once only. because when i am using encache with hibernate it is giving me below error.

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

it is initializing it second time and i am getting below error for the encache.


02 May 2006 12:08:43,718 processing association property references
02 May 2006 12:08:43,718 processing foreign key constraints
02 May 2006 12:08:43,750 Using Hibernate built-in connection pool (not for production use!)
02 May 2006 12:08:43,750 Hibernate connection pool size: 20
02 May 2006 12:08:43,750 autocommit mode: false
02 May 2006 12:08:43,750 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://jayakumar:3306/rp_new
02 May 2006 12:08:43,750 connection properties: {user=root, password=dbadmin}
02 May 2006 12:08:43,781 RDBMS: MySQL, version: 5.0.16-nt
02 May 2006 12:08:43,781 JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.8 ( $Date: 2005
/04/14 20:36:13 $, $Revision: 1.27.4.64 $ )
02 May 2006 12:08:43,781 Using dialect: org.hibernate.dialect.MySQLDialect
02 May 2006 12:08:43,781 Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
02 May 2006 12:08:43,781 No TransactionManagerLookup configured (in JTA environment, use of read-write or tra
nsactional second-level cache is not recommended)
02 May 2006 12:08:43,781 Automatic flush during beforeCompletion(): disabled
02 May 2006 12:08:43,781 Automatic session close at end of transaction: disabled
02 May 2006 12:08:43,781 JDBC batch size: 15
02 May 2006 12:08:43,781 JDBC batch updates for versioned data: disabled
02 May 2006 12:08:43,781 Scrollable result sets: enabled
02 May 2006 12:08:43,781 JDBC3 getGeneratedKeys(): enabled
02 May 2006 12:08:43,781 Connection release mode: auto
02 May 2006 12:08:43,781 Maximum outer join fetch depth: 2
02 May 2006 12:08:43,781 Default batch fetch size: 1
02 May 2006 12:08:43,781 Generate SQL with comments: disabled
02 May 2006 12:08:43,781 Order SQL updates by primary key: disabled
02 May 2006 12:08:43,781 Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
02 May 2006 12:08:43,781 Using ASTQueryTranslatorFactory
02 May 2006 12:08:43,781 Query language substitutions: {}
02 May 2006 12:08:43,781 Second-level cache: enabled
02 May 2006 12:08:43,781 Query cache: disabled
02 May 2006 12:08:43,781 Cache provider: net.sf.ehcache.hibernate.EhCacheProvider
02 May 2006 12:08:43,781 Optimize cache for minimal puts: disabled
02 May 2006 12:08:43,781 Structured second-level cache entries: disabled
02 May 2006 12:08:43,781 Echoing all SQL to stdout
02 May 2006 12:08:43,781 Statistics: disabled
02 May 2006 12:08:43,781 Deleted entity synthetic identifier rollback: disabled
02 May 2006 12:08:43,781 Default entity-mode: pojo
02 May 2006 12:08:43,781 building session factory

Errorr :::

Initial SessionFactorycreation failed.org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Cann
ot parseConfiguration CacheManager. Attempt to create a new instance of CacheManager using the diskStorePath
"D:\sigma\Tomcat 5\temp" which is already used by an existing CacheManager. The source of the configuration w
as classpath.

Name and version of the database you are using:

i am using mysql 5.0

The generated SQL (show_sql=true):


Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 11:45 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
You should have only one SessionFactory per application. You should certainly have only one instance of ehcache. It is a singleton. Your EhCache error is probably due to starting more than one SessionFactory/EhCache instance.

_________________
Code tags are your friend. Know them and use them.


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