Package org.apache.ojb.broker

Examples of org.apache.ojb.broker.OJBRuntimeException


    {
        if (oid == null)
        {
            if (realSubject == null)
            {
                throw new OJBRuntimeException("Identity and real object are 'null' - Can not persist empty entry");
            }
            else
            {
                oid = new Identity(realSubject, broker);
            }
View Full Code Here


    protected void prepareRealSubject(PersistenceBroker broker)
    {
        if (oid == null)
        {
            throw new OJBRuntimeException("can not return real object, real object and Identity is null");
        }
        realSubject = broker.getObjectByIdentity(oid);
    }
View Full Code Here

                {
                    userColIterator = new ArrayIterator(userCol);
                }
                else
                {
                    throw new OJBRuntimeException(
                        userCol.getClass()
                            + " can not be managed by OJB OTM, use Array or Collection instead !");
                }

                while (userColIterator.hasNext())
View Full Code Here

            Configuration config = configurator.getConfigurationFor(null);
            pbfClass = config.getClass(PBF_KEY, null);
            if(pbfClass == null)
            {
                log.error("Creation of PersistenceBrokerFactory (PBF) instance failed, can't get PBF class object");
                throw new OJBRuntimeException("Property for key '" + PBF_KEY + "' can not be found in properties file");
            }
            PersistenceBrokerFactoryIF result = (PersistenceBrokerFactoryIF) ClassHelper.newInstance(pbfClass);
            configurator.configure(result);
            log.info("PersistencebrokerFactory class instantiated: " + result);
            return result;
        }
        catch (Exception e)
        {
            if(e instanceof OJBRuntimeException)
            {
                throw (OJBRuntimeException) e;
            }
            else
            {
                throw new OJBRuntimeException("Error while instantiation of PersistenceBrokerFactory class", e);
            }
        }
    }
View Full Code Here

            case 3:
                key = new OrderedTuple(oid, broker.getPBKey().getAlias(),
                        new Integer(broker.getDescriptorRepository().hashCode()));
                break;
            default:
                throw new OJBRuntimeException("Unexpected error, 'cacheType =" + cachingKeyType + "' was not supported");
        }
        return key;
    }
View Full Code Here

            ocd = searchInJdbcConnectionDescriptor();
            useConnectionLevelCache = true;
        }
        if(ocd == null)
        {
            throw new OJBRuntimeException("No object cache descriptor found for " + targetClass + ", using PBKey " + broker.getPBKey()
                    + ". Please set a cache descriptor in jdbc-connection-descriptor or in class-descriptor");
        }
        else
        {
            // use a class-descriptor level cache
View Full Code Here

                }
            }
            catch(Exception e)
            {
                log.error("Can not create ObjectCache instance using class " + ocd.getObjectCache(), e);
                throw new OJBRuntimeException(e);
            }
            caches.put(key, cache);
        }
        return cache;
    }
View Full Code Here

        try
        {
            status = transaction.getStatus();
            if (status != Status.STATUS_ACTIVE)
            {
                throw new OJBRuntimeException(
                        "Transaction synchronization failed - wrong status of external container tx: " +
                        getStatusString(status));
            }
        }
        catch (SystemException e)
        {
            throw new OJBRuntimeException("Can't read status of external tx", e);
        }

        try
        {
            //Sequence of the following method calls is significant
            // 1. register the synchronization with the ODMG notion of a transaction.
            transaction.registerSynchronization((J2EETransactionImpl) odmgTrans);
            // 2. mark the ODMG transaction as being in a JTA Transaction
            // Associate external transaction with the odmg transaction.
            txRepository.set(new TxBuffer(odmgTrans, transaction));
        }
        catch (Exception e)
        {
            log.error("Cannot associate PersistenceBroker with running Transaction", e);
            throw new OJBRuntimeException(
                    "Transaction synchronization failed - wrong status of external container tx", e);
        }
    }
View Full Code Here

        {
            getConfigurator().configure(tx);
        }
        catch (ConfigurationException e)
        {
            throw new OJBRuntimeException("Cannot create new intern odmg transaction", e);
        }
        return tx;
    }
View Full Code Here

        if (ojbQuery != null)
        {
            return new ObjectSetImpl(broker, ojbQuery, limitCount);
        }
        else throw new OJBRuntimeException("internal ojbQuery not filled. Can't execute this query yet!");
    }
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.OJBRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.