[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible to use a TreeMap?



Hi Neil,

My application uses TreeMaps in database objects with ozone without any 
problems. From the looks of your exception listing I would say that the 
objects that the application is inserting are not Comparable. This is not an 
ozone problem. Try implementing the Comparable interface for your objects 
for your objects.

cheers,

don


>From: Neil Aggarwal <neil@JAMMConsulting.com>
>Reply-To: ozone-users@ozone-db.org
>To: Ozone <ozone-users@ozone-db.org>
>Subject: Possible to use a TreeMap?
>Date: Sat, 02 Dec 2000 22:49:28 -0500
>
>Hello:
>
>I have a basic question:  One of my database objects
>contains other objects in a TreeMap, but when I try to add
>more than one object to the TreeMap, I get this exception:
>
>     java.lang.ClassCastException: persistent.FileRecordImpl_Proxy
>         at java.util.TreeMap.compare(TreeMap.java:1047)
>         at java.util.TreeMap.put(TreeMap.java:449)
>         at java.util.TreeSet.add(TreeSet.java:198)
>         at persistent.ControllerImpl.addFile(ControllerImpl.java:45)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at
>org.ozoneDB.core.AbstractObjectContainer.invokeTarget(AbstractObje
>             ctContainer.java:207)
>         at
>org.ozoneDB.core.Transaction.invokeObject(Transaction.java:498)
>         at org.ozoneDB.core.DbRemote.DbInvoke.perform(DbInvoke.java:62)
>         at
>org.ozoneDB.core.Transaction.performCommand(Transaction.java:265)
>         at
>org.ozoneDB.core.TransactionManager.performCommand(TransactionMana
>             ger.java:348)
>         at
>org.ozoneDB.core.TransactionManager.completeTransaction(Transactio
>             nManager.java:315)
>         at
>org.ozoneDB.core.TransactionManager.handleCommand(TransactionManag
>             er.java:230)
>         at
>org.ozoneDB.core.InvokeServer.handleClientEvent(InvokeServer.java:
>             75)
>         at
>org.ozoneDB.DxLib.net.DxMultiServerClient.run(DxMultiServerClient.
>             java:41)
>         at java.lang.Thread.run(Thread.java:484)
>
>Is it possible to use a TreeMap in a database class?
>
>Thanks,
>	Neil.
>
>--
>Neil Aggarwal
>JAMM Consulting, Inc. -- (972) 612-6056, http://www.JAMMConsulting.com
>Custom Internet Development -- Java, JSP, servlets, databases
>

_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com