Package org.apache.ojb.broker

Examples of org.apache.ojb.broker.PersistenceBrokerException


            else
            {
                con = this.connectionFactory.lookupConnection(jcd);
            }
           
            if (con == null) throw new PersistenceBrokerException("Cannot get connection for " + jcd);
            if (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE)
            {
                try
                {
                    this.originalAutoCommitState = con.getAutoCommit();
                }
                catch (SQLException e)
                {
                    throw new PersistenceBrokerException("Cannot request autoCommit state on the connection", e);
                }
            }
            if (log.isDebugEnabled()) log.debug("Request new connection from ConnectionFactory: " + con);
        }
View Full Code Here


        catch (LookupException e)
        {
            /**
             * must throw to notify user that we couldn't start a connection
             */
            throw new PersistenceBrokerException("Can't lookup a connection", e);
        }
        if (log.isDebugEnabled()) log.debug("localBegin was called for con " + connection);
        if (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE)
        {
            if (log.isDebugEnabled()) log.debug("Try to change autoCommit state to 'false'");
View Full Code Here

    public void localRollback()
    {
        log.info("Rollback was called, do rollback on current connection " + con);
        if (!this.isInLocalTransaction)
        {
            throw new PersistenceBrokerException("Not in transaction, cannot abort");
        }
        try
        {
            //truncate the local transaction
            this.isInLocalTransaction = false;
View Full Code Here

                return (SequenceManager) ClassHelper.newInstance(seqManClass, PersistenceBroker.class, broker);
            }
            catch (Exception ex)
            {
                log.error("Could not create sequence manager for broker " + broker, ex);
                throw new PersistenceBrokerException(ex);
            }
        }
    }
View Full Code Here

            for (int i = 0; i < extentClasses.size(); i++)
            {
                Class extentClass = (Class) extentClasses.get(i);
                if (cld.getClassOfObject().equals(extentClass))
                {
                    throw new PersistenceBrokerException("Circular extent in " + extentClass +
                            ", please check the repository");
                }
                else
                {
                    // fix by Mark Rowell
View Full Code Here

    public void configure(Configuration pConfig) throws ConfigurationException
    {
        if (getConfigurationKey() == null)
        {
            getLogger().error("ConfigurableFactory configuration key is 'null'");
            throw new PersistenceBrokerException("ConfigurableFactory configuration key is 'null'");
        }
        Class clazz = pConfig.getClass(getConfigurationKey(), null);
        if (clazz == null)
        {
            getLogger().error("ConfigurableFactory configuration key class for key'" + getConfigurationKey() + "' does not exist.");
            throw new PersistenceBrokerException(
                    "ConfigurableFactory configuration key class for key'" + getConfigurationKey() + "' does not exist.");
        }
        this.setClassToServe(clazz);
    }
View Full Code Here

        }
        catch (InstantiationException e)
        {
            getLogger().error("ConfigurableFactory can't instantiate class " +
                    getClassToServe() + buildArgumentString(types, args), e);
            throw new PersistenceBrokerException(e);
        }
        catch (IllegalAccessException e)
        {
            getLogger().error("ConfigurableFactory can't access constructor for class " +
                    getClassToServe() + buildArgumentString(types, args), e);
            throw new PersistenceBrokerException(e);
        }
        catch (Exception e)
        {
            getLogger().error("ConfigurableFactory instantiation failed for class " +
                    getClassToServe() + buildArgumentString(types, args), e);
            throw new PersistenceBrokerException(e);
        }
    }
View Full Code Here

                    result = method.invoke(factoryInstance, null);
                }
            }
            catch (Exception ex)
            {
                throw new PersistenceBrokerException("Unable to build object instance of class '"
                        + cld.getClassNameOfObject() + "' from factory:" + cld.getFactoryClass()
                        + "." + cld.getFactoryMethod(), ex);
            }
        }
        return result;
View Full Code Here

     */
    public static PBKey extractAllTokens(String name)
    {
        if(name == null)
        {
            throw new PersistenceBrokerException("Could not extract PBKey, given argument is 'null'");
        }
        String user = null;
        String passwd = null;
        StringTokenizer tok = new StringTokenizer(name, REPOSITORY_NAME_SEPARATOR);
        String dbName = tok.nextToken();
View Full Code Here

                result[i] = new ValueContainer(cv, fd.getJdbcType());
            }
        }
        catch(Exception e)
        {
            throw new PersistenceBrokerException("Can't generate primary key values for given Identity " + oid, e);
        }
        return result;
    }
View Full Code Here

TOP

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

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.