Package org.apache.slide.macro

Examples of org.apache.slide.macro.ConflictException


    protected ServiceAccessException createException(SQLException e, String uri) {

        switch (e.getErrorCode()) {
            case 1213 : // thread was deadlock victim
                getLogger().log(e.getErrorCode() + ": Deadlock resolved on " + uri, LOG_CHANNEL, Logger.WARNING);
                return new ServiceAccessException(service, new ConflictException(uri));

            default :
                getLogger().log(
                    "SQL error " + e.getErrorCode() + " on " + uri + ": " + e.getMessage(),
                    LOG_CHANNEL,
View Full Code Here


                          + owner.toString()
                          + " has it" : ""),
                  LOG_CHANNEL, Logger.DEBUG);
          if (!lock.acquire(txId, 1, true, true, timeout)) {
            throw new ServiceAccessException(this,
                new ConflictException(uri));
          }
          ((HashSet) locks.get()).add(lock);
          getLogger().log("Has lock: " + txId + " locks " + uri,
              LOG_CHANNEL, Logger.DEBUG);
        }
      } catch (InterruptedException e) {
        throw new ServiceAccessException(this, new ConflictException(
            uri));
      }
    }
  }
View Full Code Here

                    + txId
                    + " for rollback",
                getLogChannel(),
                Logger.INFO);

            throw new ServiceAccessException(this, new ConflictException(uri));

        } else {

            getLogger().log(
                "Could not process URI '"
View Full Code Here

    protected ServiceAccessException createException(SQLException e, String uri) {

        switch (e.getErrorCode()) {
            case 1213 : // thread was deadlock victim
                getLogger().log(e.getErrorCode() + ": Deadlock resolved on " + uri, LOG_CHANNEL, Logger.WARNING);
                return new ServiceAccessException(service, new ConflictException(uri));

            default :
                getLogger().log(
                    "SQL error " + e.getErrorCode() + " on " + uri + ": " + e.getMessage(),
                    LOG_CHANNEL,
View Full Code Here

    protected ServiceAccessException createException(SQLException e, String uri) {

        switch (e.getErrorCode()) {
            case 1205 : // thread was deadlock victim
                getLogger().log(e.getErrorCode() + ": Deadlock resolved on " + uri, LOG_CHANNEL, Logger.WARNING);
                return new ServiceAccessException(service, new ConflictException(uri));
               
            case 547 : // referential integraty constaint was violated (like in storeObject on table URI )
            case 2627 : // primary key constraint violation (like in storeContent on table VERSION_CONTENT)
                getLogger().log(e.getErrorCode() + ": Low isolation conflict for " + uri, LOG_CHANNEL, Logger.WARNING);
                return new ServiceAccessException(service, new ConflictException(uri));
               
            default :
            getLogger().log("SQL error " + e.getErrorCode() + " on " + uri + ": " + e.getMessage(),
                LOG_CHANNEL,
                Logger.ERROR);
View Full Code Here

                    + txId
                    + " for rollback",
                LOG_CHANNEL,
                Logger.INFO);

            throw new ServiceAccessException(this, new ConflictException(uri));

        } else {

            getLogger().log(
                "Thread " + Thread.currentThread() + " marking transaction branch " + txId + " for rollback",
View Full Code Here

    String sqlstate = e.getSQLState();

    if (sqlstate.startsWith("23")) {
      getLogger().log(e.getErrorCode() + ": Deadlock resolved on " + uri,
        LOG_CHANNEL, Logger.WARNING);
      return new ServiceAccessException(service, new ConflictException(uri));
    } else if (sqlstate.startsWith("40")) {
      getLogger().log(
        e.getErrorCode() + ": Deadlock resolved on " + uri,
        LOG_CHANNEL,
        Logger.WARNING);
      return new ServiceAccessException(service, new ConflictException(uri));
    } else {
      getLogger().log(
        "SQL error "
          + e.getErrorCode()
          + " on "
View Full Code Here

                XMLValue checkoutSetValue = new XMLValue( checkoutSetProp.getValue().toString() );
                if (checkoutSetValue.iterator().hasNext()) {
                    b.append(" - please use "+checkoutSetValue.getTextValue()+" instead");
                }
            }
            throw new ConflictException(
                rUri, new SlideException(b.toString()));
        }
        content.store(sToken, coutNrds.getUri(), coutNrd, null);
       
        // update VCR to previous VR
View Full Code Here

                    XMLValue checkoutSetValue = new XMLValue( checkoutSetProp.getValue().toString() );
                    if (checkoutSetValue.iterator().hasNext()) {
                        b.append(" - please use "+checkoutSetValue.getTextValue()+" instead");
                    }
                }
                throw new ConflictException(
                    rUri, new SlideException(b.toString()));
            }
            content.store(sToken, vhrNrds.getUri(), vrNrdOld, null);
           
            // check preconditions
View Full Code Here

        ObjectNode objectClone = object.cloneObject();
        objectClone.setUri(resourceId.getUuri()); // switch to uuri
        try {
            tlockManager.lock(resourceId, uri.toString(), TLock.WRITE_LOCK);
        } catch (TLockedException e) {
            throw new ServiceAccessException(this, new ConflictException(uri.toString()));
        }
        super.storeObject(resourceId, objectClone);
    }
View Full Code Here

TOP

Related Classes of org.apache.slide.macro.ConflictException

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.