Hi Clovis,
I tend to agree with you that it should be up to the user if he likes to
define cache time none even when class implements TimeStampable
interface. But IMO we should only remove to throw an exception and
instead log a warning.
Before taking action on this I need to discuss with other commiters.
Ralf
clovis_wichoski schrieb:
Hi,
Here I had two maps, one with cache and other without, with cache I use for
CRUD operations, and without cache for queries (long queries that returns many
objects), since for this two maps I use same classes, and this classes are used
in long transaction then must implement TimeStampable, but with the no cache
map I get follow exception:
org.exolab.castor.mapping.MappingException: A cache type other than none must be used with >myapp.Person< as it implements TimeStampable.
at org.exolab.castor.persist.ClassMolder.(ClassMolder.java:282)
at org.exolab.castor.persist.ClassMolder.resolve(ClassMolder.java:533)
at org.exolab.castor.persist.LockEngine.(LockEngine.java:164)
at
org.exolab.castor.persist.PersistenceEngineFactory.createEngine(PersistenceEngineFactory.java:80)
at
org.exolab.castor.jdo.engine.DatabaseRegistry.(DatabaseRegistry.java:727)
at
org.exolab.castor.jdo.engine.DatabaseRegistry.(DatabaseRegistry.java:690)
at
org.exolab.castor.jdo.engine.DatabaseRegistry.initFromDriver(DatabaseRegistry.java:449)
at
org.exolab.castor.jdo.engine.DatabaseRegistry.initDatabase(DatabaseRegistry.java:274)
at
org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:200)
at
org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:153)
at
org.exolab.castor.jdo.JDOManager.loadConfiguration(JDOManager.java:289)
at
org.exolab.castor.jdo.JDOManager.loadConfiguration(JDOManager.java:322)
...
to solve this Exception, I see the code of ClassMolder and the found the lines:
281: if ((_timeStampable) && (_cachetype != null) && (_cachetype.equalsIgnoreCase
("none"))) {
282: throw new MappingException
(Messages.format("persist.wrongCacheTypeSpecified", _name));
283: }
in my map files without cache I declared the tag cache-type like this:
<cache-type type="none"/>
that is causing the Exception, analysing the line 281, (_cachetype != null),
then if I remove this declaration from my no cache map, I no more get
Exceptions, and the problem is solved, I can have same Class cached in one map
and dont in another.
But my doubt is because what this Exception is throw? I cant see the reason for
that.
Thanks
Clovis
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
--
Syscon Ingenieurbüro für
Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
D-72127 Kusterdingen
Germany
Tel. +49 7071 3690 52
Mobil: +49 173 9630135
Fax +49 7071 3690 98
Email: [EMAIL PROTECTED]
Web: www.syscon-world.de
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------