Hello... I was working withouth any problems on WSAD 5.1 with Hibernate 2.1bx versions. However I lastly upgraded to 2.1.1 and decided to use a JVM level cache as well. (I've chosen ecache for that purpose).. However I cannot make it work. Here is what I've done:
----------------------------------------------------------------
I've placed the ecache.xml file to my classpath:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache>
<cache name="iyte.oi.components.birimler.fakulte.model.FakulteDO"
maxElementInMemory="50"
eternal="true"/>
<cache name="iyte.oi.components.birimler.bolum.model.BolumDO"
maxElementInMemory="80"
eternal="true"/>
<cache name="iyte.oi.components.birimler.program.model.ProgramDO"
maxElementsInMemory="80"
eternal="true"/>
......
</ehcache>
-------------------------------------------------------------------
I've updated my hibernate-config.xml file as below...
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory>
<!-- properties -->
<property name="connection.datasource">jdbc/OGRENCI</property>
<property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="hibernate.default_schema">OILISANS</property>
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
<property name="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</property>
<!-- mapping files -->
<mapping resource="Birimler.hbm.xml"/>
.....
--------------------------------------------------------------------------
I've changed my mapping definitions as shown below(added <cache usage> elements):
<class name="iyte.oi.components.birimler.fakulte.model.FakulteDO" table="FAKULTELER">
<cache usage="read-write"/>
<id name="id" column="ID" type="short">
<generator class="identity"/>
</id>
<property name="fakulteAd" column="FAKULTE_AD" type="string"/>
<property name="fakulteKod" column="FAKULTE_KOD" type="string"/>
<property name="ingFakulteAd" column="ING_FAKULTE_AD" type="string"/>
<set name="bolumler" inverse="true" lazy="true">
<key column="FAKULTE_ID"/>
<one-to-many class="iyte.oi.components.birimler.bolum.model.BolumDO"/>
</set>
</class>
--------------------------------------------------------------------------
I've added the following files that come with 2.1.1 distribution to my classpath:
cglib2, commons-collections, commons-lang, dom4j, ehcache, hibernate2, jta, log4j, odmg, xerces, xml-apis...
However, while initializing session factory I get the following error:
[09.01.2004 15:49:55:984 EET] 267d267d Configuration I net.sf.hibernate.cfg.Configuration processing one-to-one association property references
[09.01.2004 15:49:55:984 EET] 267d267d Configuration I net.sf.hibernate.cfg.Configuration processing foreign key constraints
[09.01.2004 15:49:56:140 EET] 267d267d Dialect I net.sf.hibernate.dialect.Dialect Using dialect: net.sf.hibernate.dialect.DB2Dialect
[09.01.2004 15:49:56:156 EET] 267d267d SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Use outer join fetching: true
[09.01.2004 15:49:56:187 EET] 267d267d NamingHelper I net.sf.hibernate.util.NamingHelper JNDI InitialContext properties:{}
[09.01.2004 15:49:56:218 EET] 267d267d ConnectionFac I J2CA0122I: Resource reference jdbc/OGRENCI could not be located, so default values of the following are used: [Resource-ref settings]
res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
res-resolution-control: 999 (undefined)
[Other attributes]
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)
[09.01.2004 15:49:56:218 EET] 267d267d DatasourceCon I net.sf.hibernate.connection.DatasourceConnectionProvider Using datasource: jdbc/OGRENCI
[09.01.2004 15:49:56:375 EET] 267d267d TransactionMa I net.sf.hibernate.transaction.TransactionManagerLookupFactory instantiating TransactionManagerLookup: net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
[09.01.2004 15:49:56:390 EET] 267d267d TransactionMa I net.sf.hibernate.transaction.TransactionManagerLookupFactory instantiated TransactionManagerLookup
[09.01.2004 15:49:56:875 EET] 267d267d WSRdbDataSour u Database version is
07.02.0005
[09.01.2004 15:49:56:890 EET] 267d267d WSRdbDataSour u JDBC Driver version is
07.02.0005
[09.01.2004 15:49:57:125 EET] 267d267d SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Use scrollable result sets: true
[09.01.2004 15:49:57:125 EET] 267d267d SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Default schema set to: OILISANS
[09.01.2004 15:49:57:125 EET] 267d267d SettingsFacto I net.sf.hibernate.cfg.SettingsFactory echoing all SQL to stdout
[09.01.2004 15:49:57:125 EET] 267d267d SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Query language substitutions: {}
[09.01.2004 15:49:57:140 EET] 267d267d SettingsFacto I net.sf.hibernate.cfg.SettingsFactory cache provider:
net.sf.ehcache.hibernate.Provider
[09.01.2004 15:49:57:187 EET] 267d267d Configuration I net.sf.hibernate.cfg.Configuration instantiating and configuring caches
[09.01.2004 15:49:57:296 EET] 267d267d SystemErr R java.lang.NoSuchMethodError: java/lang/Exception.<init>(Ljava/lang/String;Ljava/lang/Throwable;)V
[09.01.2004 15:49:57:343 EET] 267d267d SystemErr R at java.lang.Throwable.<init>(Throwable.java)
[09.01.2004 15:49:57:343 EET] 267d267d SystemErr R at java.lang.Throwable.<init>(Throwable.java)
[09.01.2004 15:49:57:343 EET] 267d267d SystemErr R at java.lang.NoSuchMethodError.<init>(NoSuchMethodError.java:56)
[09.01.2004 15:49:57:343 EET] 267d267d SystemErr R at net.sf.ehcache.CacheException.<init>(CacheException.java:97)
[09.01.2004 15:49:57:390 EET] 267d267d SystemErr R at net.sf.ehcache.CacheManager.configure(CacheManager.java:156)
[09.01.2004 15:49:57:390 EET] 267d267d SystemErr R at net.sf.ehcache.CacheManager.<init>(CacheManager.java:127)
[09.01.2004 15:49:57:390 EET] 267d267d SystemErr R at net.sf.ehcache.CacheManager.create(CacheManager.java:179)
[09.01.2004 15:49:57:390 EET] 267d267d SystemErr R at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:195)
[09.01.2004 15:49:57:390 EET] 267d267d SystemErr R at net.sf.ehcache.hibernate.Plugin.<init>(Plugin.java:92)
[09.01.2004 15:49:57:390 EET] 267d267d SystemErr R at net.sf.ehcache.hibernate.Provider.buildCache(Provider.java:89)
[09.01.2004 15:49:57:390 EET] 267d267d SystemErr R at net.sf.hibernate.cfg.Configuration.configureCaches
(Configuration.java:1067)
[09.01.2004 15:49:57:390 EET] 267d267d SystemErr R at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:738)
.................
Can anyone please help me on this?
|