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: