05-09-2009 05:38 PM
During compile time, I get no errors or warnings, but when I try to persist my object, I get the exception. The stack trace is all outside my code, so I am not sure what is going on.
I am trying to persist an Object that contains many other objects, each of which contains a few more. Every custom class in it implements Persistable, and several have some primitives. Is there some better way to tell what is going on?
05-09-2009 07:43 PM
There is no way to sort this out at compile time- in fact, I was passing Persistables for a while but realized this
didn't help anything as Object is persistable but every subclass needs to be persistable too. Often you get an autocommit
to blow up- and this will not involve your code. I had two classes mixed up and once I dumpted the class names
and stared at the same output for an hour it made sense as I was just passing the wrong thing.
I guess if you know where your pointers are you can check each of them but it could take effort.
Now, I'm only using my fake-persistable-DB classes and hashes of strings for perstent objects. Sure, the "db" index targets are
objects but I only have a few of these and they tend to be simple data classes so the suspect list is now limited
and if I wanted to be really OO I could make a specific interface the DB needs to implement.
05-09-2009 09:18 PM - edited 05-09-2009 09:19 PM