I have some code that, before writing an object via ObjectDB makes a query to ensure the new object is different from what's already stored. The problem is that, before any instances of that object have been stored, the query generates an exception. I'd been expecting NoResultException to be thrown, and coded to handle that as an empty result.
What's really getting thrown is the more general PersistenceException, with a message that says "Type Blah wasn't found".
Is this expected behavior?
If it is, I don't really want to parse the exception message to work out if it's this situation or some other persistence related exception. How can I know if any of an object has been stored yet?