Package org.apache.isis.core.metamodel.adapter.version

Examples of org.apache.isis.core.metamodel.adapter.version.ConcurrencyException


                       thisVersion.different(otherVersion)) {
                       
                        if(isConcurrencyCheckingGloballyEnabled() && ConcurrencyChecking.isCurrentlyEnabled()) {
                            LOG.info("concurrency conflict detected on " + recreatedOid + " (" + otherVersion + ")");
                            final String currentUser = getAuthenticationSession().getUserName();
                            throw new ConcurrencyException(currentUser, recreatedOid, thisVersion, otherVersion);
                        } else {
                            LOG.warn("concurrency conflict detected but suppressed, on " + recreatedOid + " (" + otherVersion + ")");
                        }
                    }
                }
View Full Code Here


           thisVersion.different(otherVersion)) {
           
            if(ConcurrencyChecking.isCurrentlyEnabled()) {
                LOG.info("concurrency conflict detected on " + thisOid + " (" + otherVersion + ")");
                final String currentUser = getAuthenticationSession().getUserName();
                throw new ConcurrencyException(currentUser, thisOid, thisVersion, otherVersion);
            } else {
                LOG.warn("concurrency conflict detected but suppressed, on " + thisOid + " (" + otherVersion + ")");
            }
        }
    }
View Full Code Here

        container = new DomainObjectContainerDefault();
    }
   
    @Test
    public void whenConcurrencyException_is_recognized() throws Exception {
        ex = new ConcurrencyException("foo", RootOidDefault.create(ObjectSpecId.of("CUS"), "123"));
        assertThat(container.recognize(ex), is(not(nullValue())));
    }
View Full Code Here

                       thisVersion.different(otherVersion)) {
                       
                        if(isConcurrencyCheckingGloballyEnabled() && ConcurrencyChecking.isCurrentlyEnabled()) {
                            LOG.info("concurrency conflict detected on " + recreatedOid + " (" + otherVersion + ")");
                            final String currentUser = getAuthenticationSession().getUserName();
                            throw new ConcurrencyException(currentUser, recreatedOid, thisVersion, otherVersion);
                        } else {
                            LOG.warn("concurrency conflict detected but suppressed, on " + recreatedOid + " (" + otherVersion + ")");
                        }
                    }
                }
View Full Code Here

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

        }

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

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

    @Override
    public void delete(final ObjectSpecId objectSpecId, final String mongoId, final String version, final Oid oid) {
        final DBCollection instances = db.getCollection(objectSpecId.asString());
        final DBObject object = instances.findOne(mongoId);
        if (!object.get(PropertyNames.VERSION).equals(version)) {
            throw new ConcurrencyException("Could not delete object of different version", oid);
        }
        instances.remove(object);
        LOG.info("removed " + oid);
    }
View Full Code Here

        } 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, null);

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

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

                       thisVersion.different(otherVersion)) {
                       
                        if(isConcurrencyCheckingGloballyEnabled() && ConcurrencyChecking.isCurrentlyEnabled()) {
                            LOG.info("concurrency conflict detected on " + recreatedOid + " (" + otherVersion + ")");
                            final String currentUser = getAuthenticationSession().getUserName();
                            throw new ConcurrencyException(currentUser, recreatedOid, thisVersion, otherVersion);
                        } else {
                            LOG.warn("concurrency conflict detected but suppressed, on " + recreatedOid + " (" + otherVersion + ")");
                        }
                    }
                }
View Full Code Here

           thisVersion.different(otherVersion)) {
           
            if(ConcurrencyChecking.isCurrentlyEnabled()) {
                LOG.info("concurrency conflict detected on " + thisOid + " (" + otherVersion + ")");
                final String currentUser = getAuthenticationSession().getUserName();
                throw new ConcurrencyException(currentUser, thisOid, thisVersion, otherVersion);
            } else {
                LOG.warn("concurrency conflict detected but suppressed, on " + thisOid + " (" + otherVersion + ")");
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.adapter.version.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.