Program: 13277
Project: 13277
Buggy source:
@Override public Resource update(UpdateRequest request) throws ResourceException {
  String fullId=request.getResourceName();
  String[] resourceName=ResourceUtil.parseResourceName(fullId);
  if (resourceName == null) {
    throw new BadRequestException("String_Node_Str");
  }
  String localId=getLocalId(fullId);
  String type=getObjectType(fullId);
  Map<String,Object> obj=request.getNewContent().asMap();
  String rev=request.getRevision();
  Connection connection=null;
  Integer previousIsolationLevel=null;
  boolean retry=false;
  int tryCount=0;
  do {
    TableHandler handler=getTableHandler(type);
    if (handler == null) {
      throw ResourceException.getException(ResourceException.INTERNAL_ERROR,"String_Node_Str" + type);
    }
    retry=false;
    ++tryCount;
    try {
      connection=getConnection();
      previousIsolationLevel=new Integer(connection.getTransactionIsolation());
      connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
      connection.setAutoCommit(false);
      handler.update(fullId,type,localId,rev,obj,connection);
      connection.commit();
      logger.debug("String_Node_Str",fullId);
    }
 catch (    SQLException ex) {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str",new Object[]{fullId,ex.getErrorCode(),ex.getSQLState(),ex});
      }
      rollback(connection);
      if (handler.isRetryable(ex,connection)) {
        if (tryCount <= maxTxRetry) {
          retry=true;
          logger.debug("String_Node_Str",ex.getMessage());
        }
      }
      if (!retry) {
        throw new InternalServerErrorException("String_Node_Str" + ex.getMessage(),ex);
      }
    }
catch (    ResourceException ex) {
      logger.debug("String_Node_Str",fullId,ex);
      rollback(connection);
      throw ex;
    }
catch (    java.io.IOException ex) {
      logger.debug("String_Node_Str",fullId,ex);
      rollback(connection);
      throw new InternalServerErrorException("String_Node_Str",ex);
    }
catch (    RuntimeException ex) {
      logger.debug("String_Node_Str",fullId,ex);
      rollback(connection);
      throw new InternalServerErrorException("String_Node_Str" + ex.getMessage(),ex);
    }
 finally {
      if (connection != null) {
        try {
          if (previousIsolationLevel != null) {
            connection.setTransactionIsolation(previousIsolationLevel.intValue());
          }
        }
 catch (        SQLException ex) {
          logger.warn("String_Node_Str",ex);
        }
        CleanupHelper.loggedClose(connection);
      }
    }
  }
 while (retry);
  return read(Requests.newReadRequest(fullId));
}

Fixed version (ground truth):
@Override public Resource update(UpdateRequest request) throws ResourceException {
  String fullId=request.getResourceName();
  String[] resourceName=ResourceUtil.parseResourceName(fullId);
  if (resourceName == null) {
    throw new BadRequestException("String_Node_Str");
  }
  String localId=getLocalId(fullId);
  String type=getObjectType(fullId);
  Map<String,Object> obj=request.getNewContent().asMap();
  String rev=request.getRevision();
  if (rev == null) {
    rev=read(Requests.newReadRequest(fullId)).getRevision();
  }
  Connection connection=null;
  Integer previousIsolationLevel=null;
  boolean retry=false;
  int tryCount=0;
  do {
    TableHandler handler=getTableHandler(type);
    if (handler == null) {
      throw ResourceException.getException(ResourceException.INTERNAL_ERROR,"String_Node_Str" + type);
    }
    retry=false;
    ++tryCount;
    try {
      connection=getConnection();
      previousIsolationLevel=new Integer(connection.getTransactionIsolation());
      connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
      connection.setAutoCommit(false);
      handler.update(fullId,type,localId,rev,obj,connection);
      connection.commit();
      logger.debug("String_Node_Str",fullId);
    }
 catch (    SQLException ex) {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str",new Object[]{fullId,ex.getErrorCode(),ex.getSQLState(),ex});
      }
      rollback(connection);
      if (handler.isRetryable(ex,connection)) {
        if (tryCount <= maxTxRetry) {
          retry=true;
          logger.debug("String_Node_Str",ex.getMessage());
        }
      }
      if (!retry) {
        throw new InternalServerErrorException("String_Node_Str" + ex.getMessage(),ex);
      }
    }
catch (    ResourceException ex) {
      logger.debug("String_Node_Str",fullId,ex);
      rollback(connection);
      throw ex;
    }
catch (    java.io.IOException ex) {
      logger.debug("String_Node_Str",fullId,ex);
      rollback(connection);
      throw new InternalServerErrorException("String_Node_Str",ex);
    }
catch (    RuntimeException ex) {
      logger.debug("String_Node_Str",fullId,ex);
      rollback(connection);
      throw new InternalServerErrorException("String_Node_Str" + ex.getMessage(),ex);
    }
 finally {
      if (connection != null) {
        try {
          if (previousIsolationLevel != null) {
            connection.setTransactionIsolation(previousIsolationLevel.intValue());
          }
        }
 catch (        SQLException ex) {
          logger.warn("String_Node_Str",ex);
        }
        CleanupHelper.loggedClose(connection);
      }
    }
  }
 while (retry);
  return read(Requests.newReadRequest(fullId));
}