Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.PersistenceException


        if ((objectTimestamp > 0) && (oid.getIdentity() != null)) {
            // valid range of timestamp
           
            if ((_timeStampable) && (lockTimestamp == TimeStampable.NO_TIMESTAMP)) {
                throw new PersistenceException(Messages.format(
                        "persist.objectNotInCache", _name, oid.getIdentity()));
            }

            if (_timeStampable && objectTimestamp != lockTimestamp) {
                throw new ObjectModifiedException("Timestamp mismatched!");
View Full Code Here


            case FieldMolder.ONE_TO_MANY:
            case FieldMolder.MANY_TO_MANY:
                _resolvers[i].markDelete(tx, object, fields[i]);
                break;
            default:
                throw new PersistenceException("Invalid field type!");
            }
        }
    }
View Full Code Here

            throws PersistenceException {

        resetResolvers();

        if (oid.getIdentity() == null) {
            throw new PersistenceException(
                    Messages.format("persist.missingIdentityForReverting", _name));
        }

        Object[] fields = locker.getObject(tx);
View Full Code Here

            final Object object,
            final Identity identity)
            throws PersistenceException {

        if (identity.size() != _ids.length) {
            throw new PersistenceException("Identity size mismatched!");
        }

        for (int i = 0; i < _ids.length; i++) {
            _ids[i].setValue(object, identity.get(i), tx.getClassLoader());
        }
View Full Code Here

            }

            int count = 1;
            // bind the identity of the preparedStatement
            if (identity.size() != ids.length) {
                throw new PersistenceException("Size of identity field mismatched!");
            }

            for (int i = 0; i < ids.length; i++) {
                stmt.setObject(count++, ids[i].toSQL(identity.get(i)));
            }

            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.format("jdo.removing", _type, stmt.toString()));
            }

            int result = stmt.executeUpdate();
            if (result < 1) {
                throw new PersistenceException("Object to be deleted does not exist! " + identity);
            }

            // Must delete record in parent table last.
            // All other dependents have been deleted before.
            if (extended != null) {
                extended.delete(conn, identity);
            }
        } catch (SQLException except) {
            LOG.fatal(Messages.format("jdo.deleteFatal", _type, _statement), except);
            throw new PersistenceException(Messages.format("persist.nested", except), except);
        } finally {
            try {
                if (stmt != null) { stmt.close(); }
            } catch (Exception e) {
                LOG.warn("Problem closing JDBC statement", e);
View Full Code Here

            }
           
            // bind the identity to the preparedStatement
            int count = 1;
            if (identity.size() != ids.length) {
                throw new PersistenceException("Size of identity field mismatched!");
            }
            for (int i = 0; i < ids.length; i++) {
                stmt.setObject(count++, ids[i].toSQL(identity.get(i)));
            }
View Full Code Here

            try {
                retVal = _rset.getObject(1);
                _hasMore = _rset.next();
            } catch (SQLException except) {
                if (!skipError) {
                    throw new PersistenceException(except.toString());
                }
            }
           
            return retVal;
        }
View Full Code Here

                                "persist.simple.query.failed"), except);
                    }
                    _fieldNum = 0;
                    break;
                default:
                    throw new PersistenceException("Unknown projection type: " + _projectionType);
            }
        } catch (PersistenceException except) {
            throw except;
        }
View Full Code Here

            try {
                if (_rset != null) {
                    retval = _rset.absolute(row);
                }
            } catch (SQLException e) {
                throw new PersistenceException(e.getMessage());
            }
            return retval;
        }
View Full Code Here

                    } else {
                        _rset.beforeFirst();
                    }
                }
            } catch (SQLException se) {
                throw new PersistenceException(se.getMessage());
            }
            return retval;
        }
View Full Code Here

TOP

Related Classes of org.exolab.castor.jdo.PersistenceException

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.