Microsoft KB Archive/267844

= PRB: Calling CreateSharedPropertyGroup with LockMethod in the Same Activity Causes Failfast =

Article ID: 267844

Article Last Modified on 9/22/2006

-

APPLIES TO


 * Microsoft Transaction Services 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.



Steps to Reproduce Behavior
  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(&quot;A&quot;, LockMethod, Standard, bExist) Set prop1 = group1.CreateProperty(&quot;a&quot;, bExist) Set group2 = spm.CreatePropertyGroup(&quot;B&quot;, LockMethod, Standard, bExist) Set prop2 = group2.CreateProperty(&quot;b&quot;, bExist) Exit Sub handler: App.LogEvent CStr(Err.Number) + &quot; &quot; + Err.Description End Sub </li> 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.</li> Create a Visual Basic application that creates the above component and calls CreateGroups.</li></ol>

You will see the errors described in the &quot;Symptoms&quot; section.

Additional query words: fail fast event log

Keywords: kberrmsg kbprb KB267844

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.