Back to Devexpress

DocumentManager.HibernatedDocumentsDisposeTimeout Property

aspnet-devexpress-dot-web-dot-office-dot-documentmanager-51a6d25a.md

latest4.0 KB
Original Source

DocumentManager.HibernatedDocumentsDisposeTimeout Property

Specifies how long hibernated documents are stored on the server before disposal.

Namespace : DevExpress.Web.Office

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public static TimeSpan HibernatedDocumentsDisposeTimeout { get; set; }
vb
Public Shared Property HibernatedDocumentsDisposeTimeout As TimeSpan

Property Value

TypeDefaultDescription
TimeSpanTimeSpan.FromHours(24)

An object that specifies the storage time for hibernated documents.

|

Remarks

When the document hibernation is enabled (the EnableHibernation property is set to true), the DocumentManager hibernates inactive open documents after an idle timeout (HibernateTimeout) has passed.

Use the HibernatedDocumentsDisposeTimeout property to specify how long hibernated documents are stored on the server before disposal.

Example

Specify the hibernation settings in the Application_Start method handler in the global.asax file. In this instance, users are not required to reload the page with the Spreadsheet control and can continue to work with the open document even after a server failure.

The following code sample demonstrates how to define the hibernation settings:

csharp
using DevExpress.Web.Office;

namespace YOUR_APP_ROOT_NAMESPACE {  
    public class Global_asax : System.Web.HttpApplication {  

        void Application_Start(object sender, EventArgs e) {  
            // Code that runs on application startup
            DocumentManager.HibernationStoragePath = Server.MapPath("~/App_Data/HibernationStorage/"); // Required setting
            DocumentManager.HibernateTimeout = TimeSpan.FromMinutes(30); // Optional setting
            DocumentManager.HibernatedDocumentsDisposeTimeout = TimeSpan.FromDays(1); // Optional setting
            DocumentManager.HibernateAllDocumentsOnApplicationEnd = true; // Optional setting
            DocumentManager.EnableHibernation = true; // Required setting to turn the hibernation on
        }  
    }  
}
vb
Imports DevExpress.Web.Office

Namespace YOUR_APP_ROOT_NAMESPACE
    Public Class [Global]
        Inherits HttpApplication

        Private Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
            ' Code that runs on application startup
            DocumentManager.HibernationStoragePath = Server.MapPath("~/App_Data/HibernationStorage/") ' Required setting
            DocumentManager.HibernateTimeout = TimeSpan.FromMinutes(30) ' Optional setting
            DocumentManager.HibernatedDocumentsDisposeTimeout = TimeSpan.FromDays(1) ' Optional setting
            DocumentManager.HibernateAllDocumentsOnApplicationEnd = True ' Optional setting
            DocumentManager.EnableHibernation = True ' Required setting to turn the hibernation on           
        End Sub
    End Class
End Namespace

See Also

Spreadsheet Document Hibernation

Rich Text Editor Document Hibernation

DocumentManager Class

DocumentManager Members

DevExpress.Web.Office Namespace