ObjectDB ObjectDB

Issue #1699: Feature Request: Subclassed PersistenceException for Type Not Found in DB Schema

Type: Feature requestVersion: 2.6.3Priority: NormalStatus: ClosedReplies: 3

Our application uses a sharding strategy with ObjectDB.  We have numerous ODB files with different schemas managed by the same ObjectDB server that are sharded based on the day.  We let ObjectdDB create the schema in each ODB file the first time objects are persisted.  The problem is that when a process runs that querys a shard before the schema is created a generic PersistenceException is thrown.  For us, and I assume many other users, this isn’t a problem and we would like our application to behave like the query returned nothing.  We can’t implement this behavior in our application without parsing the exception text.  It would be very nice if this particular exception were a type/subclass of PersistenceException that we can catch and handle differently than more critical PersistenceExceptions. 

Please consider this suggestion and let me know if this is something that can be done or if you have alternative solutions to the problem.

Thank you,

Clinton Moore


com.adheris.cap.summaryframework.entities.daos.SummaryArchiveDAO:206 -> Query failed due to
TEX: Type AbstractClientSummary is not found

One of the methods that returns this exception every day a before a new shard is created.
    public List<Integer> getDistinctStores(String chain) {

        List<Integer> storeList = new ArrayList<Integer>();

        String queryString = "select DISTINCT(summary.store) from AbstractClientSummary summary WHERE summary.chain == :chain";
        TypedQuery<Integer> query = manager.createQuery(queryString, Integer.class);
        query.setParameter("chain", Integer.parseInt(chain));
        try {
            storeList = query.getResultList();
        } catch (PersistenceException e) {
            logger.error("Query failed due to {}", ExceptionAssistant.getStackTrace(e));


This feature request is related to the following posts:




Have you tried the solutions in these posts? It may be better to avoid this exception by introducing the relevant classes to ObjectDB before the first query. If you still have to catch these exceptions, maybe you can identify them by getCause(), since the underlying exception could be different.


ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Thank you very much for your help!  This issue is resolved.

Introducing the type to the database prior to the query worked as suggested.



Good. So this feature request will be closed.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply