-->
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: ehcache and CompositeUserType ???
PostPosted: Fri Nov 14, 2003 4:31 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
Hi all,

I am trying to make my app working with ehcache.

I use a CompositeUSerType and looks like the cache requires me to implement assemble/disassemble. Where can I find some hints on these 2 functions?

The error I am getting:
...............................
15:23:26,920 INFO SettingsFactory:89 - Use scrollable result sets: true
15:23:26,920 INFO SettingsFactory:96 - echoing all SQL to stdout
15:23:26,920 INFO SettingsFactory:99 - Query language substitutions: {no='N', true=1, yes='Y', false=0}
15:23:26,920 INFO SettingsFactory:110 - cache provider: net.sf.ehcache.hibernate.Provider
15:23:26,920 INFO Configuration:990 - instantiating and configuring caches
Nov 14, 2003 3:23:26 PM net.sf.ehcache.config.Configurator configure
WARNING: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: file:/E:/wsad_work/workspace/DeviceMgmt/ehcache-failsafe.xml.
Nov 14, 2003 3:23:27 PM net.sf.ehcache.store.MemoryStore <init>
INFO: initialized MemoryStore for com.db.device.NEMgmtInfo
15:23:27,076 INFO SessionFactoryImpl:118 - building session factory
15:23:32,763 INFO SessionFactoryObjectFactory:82 - no JNDI name configured
15:23:32,825 INFO HibernateSession:40 - Session opened
15:23:33,013 INFO HibernateSession:69 - Session closed
java.lang.UnsupportedOperationException
at com.db.device.IPV4AddressType.disassemble(IPV4AddressType.java:139)
at net.sf.hibernate.type.CompositeCustomType.disassemble(CompositeCustomType.java:111)
at net.sf.hibernate.impl.CacheEntry.disassemble(CacheEntry.java:36)
at net.sf.hibernate.impl.CacheEntry.<init>(CacheEntry.java:27)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2217)
at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:216)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:111)
at net.sf.hibernate.loader.Loader.find(Loader.java:731)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:972)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:45)
at com.dao.DeviceDAO.getAllDevices(DeviceDAO.java:561)
at com.db.device.DeviceHelper.getAllDevices(DeviceHelper.java:42)
at com.db.device.MainDevice.go(MainDevice.java:389)
at com.db.device.MainDevice.main(MainDevice.java:48)
Exception in thread "main"

thx much.
--steve p.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 14, 2003 6:29 pm 
Newbie

Joined: Tue Oct 21, 2003 7:59 pm
Posts: 9
ehcache is warning that you have not configured it. It might clarify things to configure the cache and re-run. See http://ehcache.sourceforge.net/document ... figuration for an example ehcache.xml configuration file. Edit this to your liking and place it in the classpath. A copy is also included in the distribution.

ehcache will use it, when it finds it, rather than the fail safe. The fail safe is only useful for application outside Hibernate, where it provides enough information for startup and then you fully specify your caches and add them to CacheManager.

The only constraint ehcache imposes on cache keys and values is that they are Serializable.

If you still have problems beyond that post the source code snippet involved.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 14, 2003 10:04 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
I solved the problem by implementing assemble/disassemble of CompositeUserType (basically a deep copy)

regards,
--steve p.


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.