Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2.6
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.slideshow.domain.PhotoDetails" table="photo_details" mutable="true">
<cache usage="read-write"/>
<composite-id unsaved-value="any">
<key-many-to-one name="photo" column="photo_id"/>
<key-many-to-one name="photoType" column="photo_type_id"/>
</composite-id>
<property name="filename" column="file_name" not-null="false" type="string"/>
<property name="directoryname" column="directory_name" not-null="false" type="string"/>
<property name="sizeX" column="size_x" not-null="false" type="integer"/>
<property name="sizeY" column="size_y" not-null="false" type="integer"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
This exception is happening only whne the objects are stored on the Disk.
Ehcache version 1.6.0-beta3
ERROR org.hibernate.LazyInitializationException - could not initialize proxy - no Session
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)
at com.amg.condenet.style.slideshow.domain.PhotoType$$EnhancerByCGLIB$$29c73427.equals(<generated>)
at org.hibernate.util.EqualsHelper.equals(EqualsHelper.java:10)
at org.hibernate.type.AbstractType.isEqual(AbstractType.java:108)
at org.hibernate.type.ComponentType.isEqual(ComponentType.java:125)
at org.hibernate.cache.CacheKey.equals(CacheKey.java:56)
at net.sf.ehcache.Element.equals(Element.java:283)
at net.sf.ehcache.store.LfuPolicy.selectedBasedOnPolicy(LfuPolicy.java:45)
at net.sf.ehcache.store.LfuMemoryStore.findRelativelyUnused(LfuMemoryStore.java:120)
at net.sf.ehcache.store.LfuMemoryStore.removeLfuElement(LfuMemoryStore.java:97)
at net.sf.ehcache.store.LfuMemoryStore.doPut(LfuMemoryStore.java:85)
at net.sf.ehcache.store.MemoryStore.put(MemoryStore.java:112)
at net.sf.ehcache.Cache.searchInDiskStore(Cache.java:1216)
at net.sf.ehcache.Cache.get(Cache.java:814)
at net.sf.ehcache.hibernate.EhCache.get(EhCache.java:84)
at org.hibernate.cache.ReadWriteCache.get(ReadWriteCache.java:80)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:490)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:357)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
Name and version of the database you are using:
Oracle 10g
The generated SQL (show_sql=true):
n/a
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html