Package org.apache.isis.runtimes.dflt.runtime.persistence

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.ConcurrencyException


        if (source == null) {
            return e;
        }
        final ObjectAdapter failedObject = getAdapterManager().getAdapterFor(source);
        getPersistenceSession().reload(failedObject);
        return new ConcurrencyException("Object automatically reloaded: " + failedObject.titleString(), e);
    }
View Full Code Here


    @Override
    public void checkLock(final Version version) {
        if (this.version != null && this.version.different(version)) {
            LOG.info("concurrency conflict on " + this + " (" + version + ")");
            throw new ConcurrencyException(this, version);
        }
    }
View Full Code Here

        sql.append(" AND ");
        sql.append(versionMapping.whereClause(connector, (SerialNumberVersion) object.getVersion()));
        final int updateCount = connector.update(sql.toString());
        if (updateCount == 0) {
            LOG.info("concurrency conflict object " + this + "; no deletion performed");
            throw new ConcurrencyException("", object.getOid());
        }
    }
View Full Code Here

        sql.append(versionMapping.whereClause(connector, (SerialNumberVersion) object.getVersion()));

        final int updateCount = connector.update(sql.toString());
        if (updateCount == 0) {
            LOG.info("concurrency conflict object " + this + "; no update performed");
            throw new ConcurrencyException("", object.getOid());
        } else {
            object.setOptimisticLock(createVersion(nextSequence));
        }

        // TODO update collections - change only when needed rather than
View Full Code Here

            throw new ObjectNotFoundException(message);
        } else if (status.equals("concurrency")) {
            final String data = getResponseData();
            // TODO create better exceptions (requires way to restore object/version)
            if (data.startsWith("{")) {
                throw new ConcurrencyException(data, (Throwable) null);

            } else {
                throw new ConcurrencyException(data, (Throwable) null);

            }
        } else if (!status.equals("ok")) {
            throw new RemotingException("Invalid status in response: " + status);
        }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.persistence.ConcurrencyException

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.