/** * Creates a new MappingRuntimeException * * @param message the error message **/ public MappingRuntimeException(String message) { super(Messages.message(message)); } // -- MappingRuntimeException
public MappingException(String message) { super(Messages.message(message)); }
public ValidityException(String message) { super(Messages.message(message)); }
ObjectDeletedWaitingForLockException() { super(Messages.message("persist.deletedWaitingForLock")); }
/** * @inheritDoc */ public void begin() throws PersistenceException { throw new IllegalStateException(Messages.message("jdo.txInJ2EE")); }
/** * @inheritDoc */ public void rollback() throws TransactionNotInProgressException { throw new IllegalStateException(Messages.message("jdo.txInJ2EE")); }
public void endDocument() throws SAXException { if (_insideRoot) throw new SAXException(Messages.message("dsml.documentRootStillOpen")); }
/** * @inheritDoc */ public void commit() throws TransactionNotInProgressException, TransactionAbortedException { throw new IllegalStateException(Messages.message("jdo.txInJ2EE")); }
/** * Closes the ResultSet without throwing SQLException. A warning is added to * the log if SQLException is thrown. * * @param rs The ResultSet to close */ public static void closeResultSet(final ResultSet rs) { if (rs != null) { try { rs.close(); } catch (SQLException e) { LOG.warn(Messages.message("persist.rsClosingFailed"), e); } } }
/** * Closes the Connection without throwing SQLException. A warning is added * to the log if SQLException is thrown. * * @param conn The Connection to close */ public static void closeConnection(final Connection conn) { if (conn != null) { try { if (!conn.isClosed()) { conn.close(); } } catch (SQLException e) { LOG.warn(Messages.message("persist.connClosingFailed"), e); } } }
public void setImportEventListener(ImportEventListener listener) throws TooManyListenersException { if (_listener != null) throw new TooManyListenersException(Messages.message("dsml.onlyOneListener")); _listener = listener; }
synchronized void invalidate(final TransactionContext tx) { if (tx != _writeLock) { throw new IllegalStateException(Messages.message( "persist.notOwnerLock") + " oid:" + _oid + "/" + _id + " by " + tx); } if (LOG.isDebugEnabled()) { LOG.debug ("Delete " + this.toString() + " by " + tx); } _invalidated = true; }
public MappingException(String message, Exception e) { super(Messages.message(message)); setException(e); }
/** * {@inheritDoc} */ public boolean isPersistent(final Object object) { if (_scope == null) { throw new IllegalStateException(Messages.message("jdo.dbClosed")); } if (isActive()) { return _ctx.isPersistent(object); } return false; }
/** * Throws a PersistenceException if the database is closed, otherwise it does nothing. * * @throws PersistenceException */ private void testForOpenDatabase() throws PersistenceException { if (_db.isClosed()) { throw new PersistenceException(Messages.message("jdo.dbClosed")); } } }
/** * {@inheritDoc} */ public Identity getIdentity(final Object object) throws PersistenceException { if (_scope == null) { throw new PersistenceException(Messages.message("jdo.dbClosed")); } ClassMolder molder = _scope.getClassMolder(object.getClass()); return molder.getActualIdentity(_classLoader, object); }
/** * {@inheritDoc} */ public void lock(final Object object) throws PersistenceException { if (!isActive()) { throw new TransactionNotInProgressException(Messages.message("jdo.txNotInProgress")); } _ctx.writeLock(object, _lockTimeout); }
/** * @inheritDoc * @see org.exolab.castor.jdo.Database#rollback() */ public void rollback() throws TransactionNotInProgressException { _log.debug("Rolling back tx"); if (!isActive()) { throw new TransactionNotInProgressException(Messages.message("jdo.txNotInProgress")); } _ctx.rollback(); unregisterSynchronizables(); }
/** * @inheritDoc * @see org.exolab.castor.jdo.Database#getJdbcConnection() */ public Connection getJdbcConnection() throws PersistenceException { if (_ctx == null || !_ctx.isOpen()) { String message = Messages.message("jdo.dbTxNotInProgress.jdbc"); throw new PersistenceException (message); } return _ctx.getConnection(_scope.getLockEngine()); } }
/** * {@inheritDoc} */ public boolean isLocked(final Class cls, final Object identity) throws PersistenceException { if (identity == null) { throw new PersistenceException("Identities can't be null!"); } if (_scope == null) { throw new PersistenceException(Messages.message("jdo.dbClosed")); } if (isActive()) { return _ctx.isLocked(cls, new Identity(identity), _scope.getLockEngine()); } return false; }