Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

Posts: 109
Registered: ‎02-09-2009
My Device: Not Specified

Problems with strange NonPersistableObjectExceptions at runtime

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?



Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Problems with strange NonPersistableObjectExceptions at runtime

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.


Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Problems with strange NonPersistableObjectExceptions at runtime

[ Edited ]
Usually a common gotcha is when you have a persistable vector, but what you put in the vector is not marked persistable.
Message Edited by mreed on 05-09-2009 08:19 PM
Posts: 109
Registered: ‎02-09-2009
My Device: Not Specified

Re: Problems with strange NonPersistableObjectExceptions at runtime

Took me a while, but I found out I had left the interface on a class with a Random. Thanks!