Package org.apache.ojb.broker

Examples of org.apache.ojb.broker.PersistenceBrokerException


           
        }
        catch (Exception ex)
        {
            throw new PersistenceBrokerException("Unable to create proxy using class:"+baseClassForProxy.getName(), ex);
        }
    }
View Full Code Here


        {
            return broker.getCount(getQuery());
        }
        catch (Exception ex)
        {
            throw new PersistenceBrokerException(ex);
        }
        finally
        {
            releaseBroker(broker);
        }
View Full Code Here

            }
            return result;
        }
        catch (Exception ex)
        {
            throw new PersistenceBrokerException(ex);
        }
        finally
        {
            releaseBroker(broker);
        }
View Full Code Here

        {
            stmt = sm.getDeleteStatement(cld);
            if (stmt == null)
            {
                logger.error("getDeleteStatement returned a null statement");
                throw new PersistenceBrokerException("JdbcAccessImpl: getDeleteStatement returned a null statement");
            }

            sm.bindDelete(stmt, cld, obj);
            if (logger.isDebugEnabled())
                logger.debug("executeDelete: " + stmt);
View Full Code Here

        {
            stmt = sm.getInsertStatement(cld);
            if (stmt == null)
            {
                logger.error("getInsertStatement returned a null statement");
                throw new PersistenceBrokerException("getInsertStatement returned a null statement");
            }
            // before bind values perform autoincrement sequence columns
            assignAutoincrementSequences(cld, obj);
            sm.bindInsert(stmt, cld, obj);
            if (logger.isDebugEnabled())
                logger.debug("executeInsert: " + stmt);
            stmt.executeUpdate();
            // after insert read and assign identity columns
            assignAutoincrementIdentityColumns(cld, obj);

            // Harvest any return values.
            harvestReturnValues(cld.getInsertProcedure(), obj, stmt);
        }
        catch (PersistenceBrokerException e)
        {
            logger.error("PersistenceBrokerException during the execution of the insert: " + e.getMessage(), e);
            throw e;
        }
        catch(SequenceManagerException e)
        {
            throw new PersistenceBrokerException("Error while try to assign identity value", e);
        }
        catch (SQLException e)
        {
            final String sql = broker.serviceSqlGenerator().getPreparedInsertStatement(cld).getStatement();
            throw ExceptionHelper.generateException(e, sql, cld, logger, obj);
View Full Code Here

        {
            stmt = sm.getUpdateStatement(cld);
            if (stmt == null)
            {
                logger.error("getUpdateStatement returned a null statement");
                throw new PersistenceBrokerException("getUpdateStatement returned a null statement");
            }

            sm.bindUpdate(stmt, cld, obj);
            if (logger.isDebugEnabled())
                logger.debug("executeUpdate: " + stmt);
View Full Code Here

        {
            stmt = sm.getSelectByPKStatement(cld);
            if (stmt == null)
            {
                logger.error("getSelectByPKStatement returned a null statement");
                throw new PersistenceBrokerException("getSelectByPKStatement returned a null statement");
            }
            /*
            arminw: currently a select by PK could never be a stored procedure,
            thus we can always set 'false'. Is this correct??
            */
 
View Full Code Here

                    log.info("Set autoCommit(" + newState + ") failed: " + e.getMessage());
                }
                else
                {
                    log.error("Set autoCommit(" + newState + ") failed", e);
                    throw new PersistenceBrokerException("Set autoCommit(false) failed", e);
                }
            }
        }
    }
View Full Code Here

            releaseConnection();
        }
        if (con == null)
        {
            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);
        // change autoCommit state only if we are not in a managed environment
        // and it is enabled by user
        if(!broker.isManaged())
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.