throw new RepositoryException(message.toString(), e);
}
else if (errMessage.toLowerCase().toUpperCase().indexOf(conn.JCR_PK_ITEM) >= 0)
{
message.append("Item already exists. Condition: ID. ").append(itemInfo);
throw new JCRInvalidItemStateException(message.toString(), item.getIdentifier(), ItemState.UPDATED, e);
}
// try detect integrity violation
RepositoryException ownException = null;
try
{
ItemData me = conn.getItemData(item.getIdentifier());
if (me != null)
{
// item already exists
message.append("Item already exists. But update errors. ").append(itemInfo);
ownException = new RepositoryException(message.toString(), e);
throw ownException;
}
}
catch (Exception ep)
{
// item not found or other things but error of item reading
if (ownException != null)
throw ownException;
}
message.append("Error of item update. ").append(itemInfo);
throw new JCRInvalidItemStateException(message.toString(), item.getIdentifier(), ItemState.UPDATED, e);
}