PRB: Calling CreateSharedPropertyGroup with LockMethod in the Same Activity Causes Failfast (267844)



The information in this article applies to:

  • Microsoft Transaction Server 2.0
  • Microsoft COM+ 1.0

This article was previously published under Q267844

SYMPTOMS

When you use the Shared Property Manager (SPM) to create Shared Property Groups, the following error messages are found in the Microsoft Windows NT eventlog:
  • Under COM+ on Windows 2000
    Event Type: Error
    Event Source: COM+
    Event Category: SVC
    Event ID: 4097
    Date: 8/28/2000
    Time: 4:35:00 PM
    User: N/A
    Computer: MYCOMPUTER
    Description: The run-time environment has detected an inconsistency in its internal state. Please contact Microsoft Product Support Services to report this error. Error in .\spgobj.cpp(119): An attempt was made to access a SPM Property Group in LockMethod mode, by an object without JIT Activation, or by an object with a lock on another Property Group.
  • Under COM+ on Windows XP
    Event Type: Error
    Event Source: COM+
    Event Category: (100)
    Event ID: 4741
    Date: 1/21/2002
    Time: 2:26:57 PM
    User: N/A
    Computer: BRETB3
    Description: An attempt was made to access a SPM Property Group in LockMethod mode, by an object without JIT Activation, or by an object with a lock on another Property Group.

    Server Application ID: {A276EED3-B447-46CC-BA12-5ACD9CED84C2}
    Server Application Instance ID: {81FFBF0C-8894-425A-B946-41527654A8F0}
    Server Application Name: SweepTestTwo
    The serious nature of this error has caused the process to terminate.
    Error Code = 0x8004e004 : There is no MTS object context COM+ Services
    Internals Information: File: d:\nt\com\com1x\src\comsvcs\spm\spgobj.cpp
    Line: 127
    Comsvcs.dll file version: ENU 2001.12.4414.42 shp For more information, see Help and Support Center at http://support.microsoft.com.
  • Under MTS
    Event Type: Error
    Event Source: Transaction Server
    Event Category: (2)
    Event ID: 4097
    Date: 8/16/2000
    Time: 15:27:18 PM
    User: N/A
    Computer: MYCOMPUTER
    Description:
    The run-time environment has detected an inconsistency in its internal state and has terminated the process. Please contact Microsoft Product Support Services to report this error. Internal Check Failure on condition: gMapMethodLocks[pIObjectContext] == this (Microsoft Transaction Server Internals Information: File: d:\viper\src\runtime\mtxspm\spgobj.cpp, Line: 78)
The following error message is returned to a Microsoft Visual Basic client in Windows NT 4.0:
Run-time error '7'.
Out of Memory
The following error message is returned to a Visual Basic client in Microsoft Windows 2000 and Windows XP Pro:
Run-time error '-2147023170 (800706be)':
Automation Error
The remote procedure call failed.
The MTS or COM+ process will failfast.

CAUSE

This problem is caused because two property groups have been created with the isolation mode set to LockMethod. When you add a property to the second group, these errors are encountered.

The reason for this is deadlock prevention. If component A in activity A creates a Group A with the isolation mode LockMethod, then component B in activity B creates group B with the isolation mode LockMethod. When component A now wants to access group B and component B wants to access group A, a deadlock occurs. Note that the isolation mode is set for the lifetime of the group. In other words, you can't create it with LockMethod and then access it with LockGetSet.

RESOLUTION

When you use more than one property group per MTS or COM+ activity (method call from the COM+ or MTS perspective), you should use the LockGetSet method instead of the LockMethod isolation mode. You cannot create the first group with LockMethod and then create subsequent groups with LockGetSet, because you don't have control over the isolation mode once the group has been created.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a Visual Basic ActiveX component and add the following code:
    Public Sub CreateGroups()
        Dim spm As SharedPropertyGroupManager
        Dim group1 As SharedPropertyGroup
        Dim group2 As SharedPropertyGroup
        Dim prop1 As SharedProperty
        Dim prop2 As SharedProperty
        Dim bExist As Boolean
        
        On Error GoTo handler
        
        Set spm = New SharedPropertyGroupManager
        Set group1 = spm.CreatePropertyGroup("A", LockMethod, Standard, bExist)
        Set prop1 = group1.CreateProperty("a", bExist)
        Set group2 = spm.CreatePropertyGroup("B", LockMethod, Standard, bExist)
        Set prop2 = group2.CreateProperty("b", bExist)
        
        Exit Sub
    handler:
        App.LogEvent CStr(Err.Number) + " " + Err.Description
        
    End Sub
    					
  2. Compile the component, set the binary compatibility and the retained-in-memory and unattended execution, and then add the component to an MTS package or COM+ application.
  3. Create a Visual Basic application that creates the above component and calls CreateGroups.
You will see the errors described in the "Symptoms" section.

Modification Type:MajorLast Reviewed:9/22/2006
Keywords:kberrmsg kbprb KB267844