Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • lothar 25 posts 99 karma points
    Jul 04, 2013 @ 12:35
    lothar
    0

    Umbraco 6 Deleting document - Thread was being aborted.

    When trying to delete Documents i'm getting the following error:

    System.Threading.ThreadAbortException: Thread was being aborted.
       at SNIReadSync(SNI_Conn* , SNI_Packet** , Int32 )
       at SNINativeMethodWrapper.SNIReadSync(SafeHandle pConn, IntPtr& packet, Int32 timeout)
       at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
       at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
       at System.Data.SqlClient.TdsParserStateObject.ReadByte()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Umbraco.Core.Persistence.Database.Execute(String sql, Object[] args)
       at Umbraco.Core.Persistence.Repositories.PetaPocoRepositoryBase`2.PersistDeletedItem(TEntity entity)
       at Umbraco.Core.Persistence.Repositories.ContentRepository.PersistDeletedItem(IContent entity)
       at Umbraco.Core.Persistence.Repositories.RepositoryBase`2.PersistDeletedItem(IEntity entity)
       at Umbraco.Core.Persistence.UnitOfWork.PetaPocoUnitOfWork.Commit()
       at Umbraco.Core.Services.ContentService.Delete(IContent content, Int32 userId)
       at umbraco.cms.businesslogic.web.Document.DeletePermanently()
       at umbraco.cms.businesslogic.web.Document.delete(Boolean deletePermanently)

    I searched the web to delete Documents properly and this is what I use to delete documents:

    // first check if published, then unpublish
    if (d.Published) {
        d.UnPublish();
        umbraco.library.UnPublishSingleNode(d.Id);
    }

    // delete permanently
    d.delete(true);

    According to the logs when the error occurs:
    The document is published and gets unpublished
    And when trying to delete it i'm getting the error above.

    I have no idea why the error occurs and hope to get it resolved by posting it here.

    Can somebody tell me if i'm doing something wrong to delete a document or is there another way to delete documents using Umbraco 6?

    PS: I'm using Umbraco 6.0.3

Please Sign in or register to post replies

Write your reply to:

Draft