Search code examples
tridiontridion2009

SDL Tridion 2009: Creating components through TOM API (via Interop) fails


Am facing a problem, while creating components through TOM API using .NET/COM Interop.

Actual Issue:

I have 550 components to be created through custom page. I am able to create between 400 - 470 components but after that it is getting failed and through an error message saying that

Error: Thread was being aborted.

Any idea / suggestion, why it is getting failed?

OR

Is there any restriction on Tridion 2009?

UPDATE 1:

As per @user978511 request, below is error on Application event log:-

Event code: 3001 
Event message: The request has been aborted. 
...
...
Process information: 
    Process ID: 1016 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information: 
    Exception type: HttpException 
    Exception message: Request timed out. 
...
...
...

UPDATE 2:

@Chris: This is my common function, which is called in a loop by passing list of params. Here am using Interop dll's.

    public static bool CreateFareComponent(.... list of params ...)
    {
        TDSE mTDSE = null;
        Folder mFolder = null;
        Component mComponent = null;

        bool flag = false;

        try
        {
            mTDSE = TDSEInitialize();
            mComponent = (Component)mTDSE.GetNewObject(ItemType.ItemTypeComponent, folderID, null);
            mComponent.Schema = (Schema)mTDSE.GetObject(constants.SCHEMA_ID, EnumOpenMode.OpenModeView, null, XMLReadFilter.XMLReadAll);
            mComponent.Title = compTitle;

            ...
            ...
            ...
            ...

            mComponent.Save(true);

            flag = true;
        }
        catch (Exception ex)
        {
            CustomLogger.Error(String.Format("Logged User: {0}  \r\n Error: {1}", GetRemoteUser(), ex.Message));
        }
        return flag;
    }

Thanks in advance.


Solution

  • As per @chris suggestions and part of immediate fix I have changed my web.config execution time out to 8000 seconds.

    <httpRuntime executionTimeout="8000"/>
    

    With this change, custom page is able to handle as of now.

    Any more best suggestion, please post it.