com+ 1.x overview frank e. redmond iii program manager com+ microsoft corporation 1-301
DESCRIPTION
COM+ 1.x Overview Frank E. Redmond III Program Manager COM+ Microsoft Corporation 1-301. COM+ 1.x Goal. Provide services that will increase the overall scalability, availability, and manageability of COM+ 1.0 applications. Agenda. Scalability Enhancements Availability Enhancements - PowerPoint PPT PresentationTRANSCRIPT
COM+ 1.x Overview COM+ 1.x Overview
Frank E. Redmond IIIFrank E. Redmond IIIProgram ManagerProgram ManagerCOM+COM+Microsoft CorporationMicrosoft Corporation
1-3011-301
COM+ 1.x GoalCOM+ 1.x Goal
Provide services that will increase the Provide services that will increase the overall scalability, availability, and overall scalability, availability, and
manageability of COM+ 1.0 manageability of COM+ 1.0 applicationsapplications
AgendaAgenda Scalability EnhancementsScalability Enhancements Availability EnhancementsAvailability Enhancements Manageability EnhancementsManageability Enhancements
Scalability EnhancementsScalability Enhancements Process RecyclingProcess Recycling Configurable Isolation LevelConfigurable Isolation Level
Process RecyclingProcess Recycling Problem:Problem: The performance of most The performance of most
applications degrades over timeapplications degrades over time Reliance on third-party code of Reliance on third-party code of
uncertain qualityuncertain quality Memory leaksMemory leaks Non-scalable resource usageNon-scalable resource usage
Solution:Solution: Shut down and restart the Shut down and restart the application’s processapplication’s process
Developer Benefit:Developer Benefit: A quick fix for A quick fix for known problems and a guard known problems and a guard against unexpected onesagainst unexpected ones
Process RecyclingProcess Recycling Configured using COM+ Admin SDKConfigured using COM+ Admin SDK
Application.RecycleLifetimeLimitApplication.RecycleLifetimeLimit Elapsed timeElapsed time
Application.RecycleCallLimitApplication.RecycleCallLimit # of calls# of calls
Application.RecycleActivationLimitApplication.RecycleActivationLimit # of activations# of activations
Application.RecycleMemoryLimitApplication.RecycleMemoryLimit Amount of memory usedAmount of memory used
Application.RecycleExpirationTimeoutApplication.RecycleExpirationTimeout Delay before recycled process is terminatedDelay before recycled process is terminated
Process RecyclingProcess Recycling Retrieve the InstanceID for the applicationRetrieve the InstanceID for the application
ICOMAdminCatalog2::GetInstanceIDFromAppIDICOMAdminCatalog2::GetInstanceIDFromAppID Recycle the process!Recycle the process!
ICOMAdminCatalog2::RecycleProcessICOMAdminCatalog2::RecycleProcess Specify reason for recyclingSpecify reason for recycling
CRR_LIFETIME_LIMITCRR_LIFETIME_LIMIT CRR_ACTIVATION_LIMITCRR_ACTIVATION_LIMIT CRR_CALL_LIMITCRR_CALL_LIMIT CRR_MEMORY_LIMITCRR_MEMORY_LIMIT CRR_RECYCLED_FROM_UICRR_RECYCLED_FROM_UI CRR_NO_REASON_SUPPLIEDCRR_NO_REASON_SUPPLIED
Process RecyclingProcess Recycling Interested parties notified via COM+ Interested parties notified via COM+
EventsEvents ICOMProcessRecycle::ProcessRecycled(ICOMProcessRecycle::ProcessRecycled(
[in] BSTR bstrAppID,[in] BSTR bstrAppID,[in] BSTR bstrInstanceID,[in] BSTR bstrInstanceID,[in] DWORD dRecycleReason)[in] DWORD dRecycleReason)
DllHost.exe
ICOMAdminCatalog2::RecycleProcess(…)
COM+ System App
If IsCallerInRole(“Administrator”){ CoRecycleThisDllHost(…) StartTimer(…)}
OLE32
CoRecycleThisDllHost(…){ … FireProcessRecycledEvent(…)}
Configurable Isolation LevelConfigurable Isolation Level Isolation level = The extent to which Isolation level = The extent to which
changes made outside a transaction changes made outside a transaction are ‘visible’ to that transactionare ‘visible’ to that transaction
‘‘Visibility’ of external changes Visibility’ of external changes (isolation level) controlled using (isolation level) controlled using lockslocks
Configurable Isolation LevelConfigurable Isolation Level Locks used to control…Locks used to control…
Whether current TX can ‘see’ Whether current TX can ‘see’ uncommitted data - Dirty Readsuncommitted data - Dirty Reads
Whether other TX’s can modify Whether other TX’s can modify existing data before the current TX existing data before the current TX ends - Unrepeatable Readsends - Unrepeatable Reads
Whether other TX’s can add new data Whether other TX’s can add new data before the current TX ends - Phantom before the current TX ends - Phantom ReadsReads
Configurable Isolation LevelConfigurable Isolation Level
Lower Isolation level = Less locking, Lower Isolation level = Less locking, more concurrency, higher potential more concurrency, higher potential for incorrect datafor incorrect data
Higher Isolation level = More Higher Isolation level = More locking, less concurrency, lower locking, less concurrency, lower potential for incorrect datapotential for incorrect data
Isolation Level Dirty Reads Unrepeatable Reads Phantom Reads
Read UncommittedRead CommittedRepeatable ReadSerializable
YesNoNoNo
YesYesNoNo
YesYesYesNo
Configurable Isolation LevelConfigurable Isolation Level Problem:Problem: COM+ 1.0 uses highest COM+ 1.0 uses highest
possible isolation level possible isolation level (SERIALIZABLE) to guarantee(SERIALIZABLE) to guarantee correct datacorrect data Overkill for some applicationsOverkill for some applications Better to be safe the sorry Better to be safe the sorry
Solution:Solution: Allow developers to Allow developers to choose the desired isolation levelchoose the desired isolation level
Developer Benefit:Developer Benefit: Potential for Potential for increased concurrency, increased concurrency, performance, and scalabilityperformance, and scalability
Configurable Isolation LevelConfigurable Isolation Level Root component determines the Root component determines the
isolation level for the entire TXisolation level for the entire TX CCI downstream component w/ CCI downstream component w/
isolation level higher than root = isolation level higher than root = E_ISOLEVELMISMATCHE_ISOLEVELMISMATCH
Component isolation level = ‘None’ Component isolation level = ‘None’ means any isolation level okmeans any isolation level ok Isolation Level = ‘None’ on root Isolation Level = ‘None’ on root
component defaults to SERIALIZABLEcomponent defaults to SERIALIZABLE Better to be safe than sorry Better to be safe than sorry
Configurable Isolation LevelConfigurable Isolation Level Configured using the COM+ Admin Configured using the COM+ Admin
SDKSDK Component.IsolationLevelComponent.IsolationLevel
AgendaAgenda Scalability EnhancementsScalability Enhancements Availability EnhancementsAvailability Enhancements Manageability EnhancementsManageability Enhancements
Availability EnhancementsAvailability Enhancements Applications as NT ServicesApplications as NT Services Memory GatesMemory Gates
Applications as NT ServicesApplications as NT Services Problem:Problem: COM+ 1.0 Applications COM+ 1.0 Applications
cannot run as NT servicescannot run as NT services Solution:Solution: Allow COM+ 1.x Allow COM+ 1.x
applications to run as NT servicesapplications to run as NT services Developer Benefit:Developer Benefit:
COM+ applications can be started at COM+ applications can be started at system boot or in ordersystem boot or in order
COM+ applications can be run as COM+ applications can be run as LocalSystemLocalSystem
COM+ applications can be easily made COM+ applications can be easily made Cluster-awareCluster-aware
Applications as NT ServicesApplications as NT Services Configured using the COM+ Admin Configured using the COM+ Admin
SDKSDK Application.RunAsServiceApplication.RunAsService
Memory GatesMemory Gates Problem:Problem: Creating components in low- Creating components in low-
memory situationsmemory situations Enough memory to create component but Enough memory to create component but
not enough to actually use itnot enough to actually use it Low-memory error-handling code typically Low-memory error-handling code typically
not well debuggednot well debugged Solution:Solution: Don’t allow servers to be Don’t allow servers to be
loaded or components to be created in loaded or components to be created in low-memory situationslow-memory situations
Developer Benefit:Developer Benefit: Increased reliability Increased reliability by avoiding not-so-well-debugged low- by avoiding not-so-well-debugged low- memory error-handling codememory error-handling code
Memory GatesMemory Gates Process creation memory gateProcess creation memory gate
E_OUTOFMEMORY if > 90% of virtual E_OUTOFMEMORY if > 90% of virtual memory being usedmemory being used
Object creation memory gateObject creation memory gate E_OUTOFMEMORY if > 95% of virtual E_OUTOFMEMORY if > 95% of virtual
memory being usedmemory being used Both gates checked in Service Both gates checked in Service
Control Manager (SCM)Control Manager (SCM)
AgendaAgenda Scalability EnhancementsScalability Enhancements Availability EnhancementsAvailability Enhancements Manageability EnhancementsManageability Enhancements
Manageability EnhancementsManageability Enhancements Pause/Disable ApplicationsPause/Disable Applications Process DumpProcess Dump Alias ComponentsAlias Components Public/Private ComponentsPublic/Private Components Application PartitionsApplication Partitions
Pause/Disable ApplicationsPause/Disable Applications Problem:Problem: No way to control No way to control
component activationscomponent activations Solution:Solution: Allow Allow
administrative/programmatic control administrative/programmatic control of component activationof component activation
Developer Benefit:Developer Benefit: COM+ COM+ applications more manageableapplications more manageable
Pause/Disable ApplicationsPause/Disable Applications Pause – Prevents future activationsPause – Prevents future activations
Existing component Existing component instances/references unaffectedinstances/references unaffected
CoCreateInstance & CoGetClassObject CoCreateInstance & CoGetClassObject return E_APP_PAUSED for paused appsreturn E_APP_PAUSED for paused apps
Only works for COM+ Server applicationsOnly works for COM+ Server applications Does not work for COM+ library applicationsDoes not work for COM+ library applications Does not work for ‘classic’ COM componentsDoes not work for ‘classic’ COM components
ICOMAdminCatalog::PauseApplicationICOMAdminCatalog::PauseApplication Resume – Allows future activationsResume – Allows future activations
ICOMAdminCatalog::ResumeApplicationICOMAdminCatalog::ResumeApplication
Pause/Disable ApplicationsPause/Disable Applications Disable – Prevents future activationsDisable – Prevents future activations
Existing component instances/references Existing component instances/references unaffectedunaffected
CoCreateInstance & CoGetClassObject return CoCreateInstance & CoGetClassObject return E_APP_DISABLED for disabled appsE_APP_DISABLED for disabled apps
Works for COM+ applications (server and Works for COM+ applications (server and library) and individual COM+ componentslibrary) and individual COM+ components Does not work for ‘classic’ COM componentsDoes not work for ‘classic’ COM components
Enable – Allows future activationsEnable – Allows future activations Application::Enabled/Component::Enabled Application::Enabled/Component::Enabled
attribute in COM+ Catalogattribute in COM+ Catalog Enabled status maintained between rebootsEnabled status maintained between reboots
Process DumpProcess Dump Problem:Problem: Difficult to troubleshoot Difficult to troubleshoot
COM+ applications in production COM+ applications in production environmentenvironment
Solution:Solution: Allow administrator to Allow administrator to dump the entire state of a process dump the entire state of a process without terminating itwithout terminating it
Developer Benefit:Developer Benefit: COM+ COM+ applications much easier to applications much easier to troubleshoottroubleshoot
Process DumpProcess Dump Process dump generated using Process dump generated using
userdump.exeuserdump.exe User-mode process dump tool takes User-mode process dump tool takes
snapshots of running processessnapshots of running processes Leaves target process virtually Leaves target process virtually
unscathedunscathed Does not “invade” target processDoes not “invade” target process Target process can continue to run Target process can continue to run
after snapshot is takenafter snapshot is taken COM+ gives userdump.exe full COM+ gives userdump.exe full
pathname of dump filepathname of dump file
Process DumpProcess Dump Dump file configured per COM+ Dump file configured per COM+
application using the COM+ Admin application using the COM+ Admin SDKSDK Application.DumpFilePathApplication.DumpFilePath
Path only (no filename) COM+ generates Path only (no filename) COM+ generates filename based on application namefilename based on application name MyApp001, MyApp002, etc.MyApp001, MyApp002, etc.
Application.MaxDumpFilesApplication.MaxDumpFiles Avoids overwriting existing dump filesAvoids overwriting existing dump files
COM+ does NOT:COM+ does NOT: Install userdump.exeInstall userdump.exe Do dump file management (Deleting, Do dump file management (Deleting,
archiving, etc.)archiving, etc.)
Alias ComponentsAlias Components CLSID = Implementation (code) + CLSID = Implementation (code) +
Configuration RequirementsConfiguration Requirements Problem: Problem: Implementation sharing Implementation sharing
done at source code leveldone at source code level Solution:Solution: Allow implementation Allow implementation
sharing to be done at binary sharing to be done at binary COMponent levelCOMponent level
Developer Benefits:Developer Benefits: Less code to write, debug, maintain!Less code to write, debug, maintain! Lower development cost!Lower development cost! Faster time to market!Faster time to market!
Alias ComponentsAlias Components Many CLSIDs sharing a single Many CLSIDs sharing a single
binary (DLL) implementation binary (DLL) implementation Configurations may be different!Configurations may be different!
CLSID1 CLSID4CLSID3CLSID2
CLSID1
Public/Private ComponentsPublic/Private Components Problem: Problem: All COM+ components are All COM+ components are
public public Solution:Solution: Allow both public and private Allow both public and private
components components Similar concept as public/private methods of Similar concept as public/private methods of
VB or C++VB or C++ Public components can be activated from Public components can be activated from
other applicationsother applications Private components can only be seen and Private components can only be seen and
activated from other components within the activated from other components within the same applicationsame application
Developer Benefit:Developer Benefit: More control of More control of functionality exposure functionality exposure Component-based application development Component-based application development
is even easieris even easier
Application PartitionsApplication Partitions Problem:Problem: Only a single Only a single
application/component application/component configuration is allowed on a single configuration is allowed on a single machinemachine
Solution:Solution: Allow multiple Allow multiple configurations of a single configurations of a single application/component on a single application/component on a single machinemachine
Developer Benefit:Developer Benefit: Easier to manage Easier to manage a few large servers vs. many small a few large servers vs. many small serversservers
Application PartitionsApplication Partitions Partitions represent logical machine Partitions represent logical machine
boundaries within a single physical boundaries within a single physical machinemachine E.g. Test Partition, Production E.g. Test Partition, Production
Partition, etc…Partition, etc… ‘‘Base Partition’ represents the actual Base Partition’ represents the actual
physical machinephysical machine COM+ applications are installed into COM+ applications are installed into
one or more partitionsone or more partitions Allows multiple COM+ application Allows multiple COM+ application
installations/configurations on a installations/configurations on a single machine!single machine!
Application PartitionsApplication Partitions Partitions are grouped into partition Partitions are grouped into partition
setssets Partition set represents a group of Partition set represents a group of
logical machineslogical machines One partition in the set is always One partition in the set is always
marked as the ‘Default’ partitionmarked as the ‘Default’ partition Users/OUs are assigned to a single Users/OUs are assigned to a single
partition setpartition set Users can only access components Users can only access components
from partitions in their partition setfrom partitions in their partition set Everyone can access the base Everyone can access the base
partitionpartition
Application PartitionsApplication Partitions Users/OUs bound to a partition setUsers/OUs bound to a partition set Partition set composed of partitionsPartition set composed of partitions
Active Directory
Machine
Org Unit
User Partition
Application
PartitionSet
Application PartitionsApplication Partitions CCI behavior varies based on CCI behavior varies based on
caller’s ‘partition context’caller’s ‘partition context’ If ‘partition context’ exists, CCI If ‘partition context’ exists, CCI
searches for:searches for: Private componentPrivate component Public component in ‘current’ partitionPublic component in ‘current’ partition Public component in base partitionPublic component in base partition
If ‘partition context’ does not exist…If ‘partition context’ does not exist… CCI establishes it based on caller identity, CCI establishes it based on caller identity,
then searches for:then searches for: Public component in ‘current’ partitionPublic component in ‘current’ partition Public component in base partitionPublic component in base partition
Application PartitionsApplication PartitionsCOM+
Partition 1
Base Partition
Partition 2
App 2
CLSID2
CLSID5
App 1
CLSID1
Lib 1
CLSID1
CLSID5
App 3
CLSID4
CLSID1
App 1
CLSID3
Demo Time!!!!!Demo Time!!!!!
SummarySummary Build component-based Build component-based
applications using COM+ 1.0 today!applications using COM+ 1.0 today! Microsoft will continue to provide Microsoft will continue to provide
new and innovate component new and innovate component services tomorrow and into the services tomorrow and into the future!future!
Benefit:Benefit: Cheaper/Easier to build Cheaper/Easier to build scalable, reliable, manageable scalable, reliable, manageable component-based applications!component-based applications!
Additional COM+ SessionsAdditional COM+ Sessions MondayMonday
1- 301COM+ 1.x Overview1- 301COM+ 1.x Overview 1- 404 Understanding COM+ Security 1- 404 Understanding COM+ Security
Pt.1Pt.1 1- 405 Understanding COM+ Security 1- 405 Understanding COM+ Security
Pt.2Pt.2 TuesdayTuesday
1- 306 Intro to COM+ Partitions1- 306 Intro to COM+ Partitions 1- 309 Using COM+ Queued 1- 309 Using COM+ Queued
ComponentsComponents 1- 308 Using COM+ Events1- 308 Using COM+ Events
Additional COM+ SessionsAdditional COM+ Sessions WednesdayWednesday
1- 305 Increasing Your Windows DNA 1- 305 Increasing Your Windows DNA Application Scalability w/ Load Application Scalability w/ Load BalancingBalancing
1- 402 COM+ Internals1- 402 COM+ Internals 1- 403 Maximizing COM+ Application 1- 403 Maximizing COM+ Application
ThroughputThroughput ThursdayThursday
1- 401 COM+ Base Services1- 401 COM+ Base Services 1- 307 Measuring Windows DNA 1- 307 Measuring Windows DNA
Application PerformanceApplication Performance 1- 201 Understanding SOAP1- 201 Understanding SOAP
Additional ResourcesAdditional Resources Microsoft COM WebsiteMicrosoft COM Website
http://www.microsoft.com/comhttp://www.microsoft.com/com MSDN WebsiteMSDN Website
http://msdn.microsoft.comhttp://msdn.microsoft.com Microsoft Platform SDKMicrosoft Platform SDK
http://msdn.microsoft.com/developer/sdk/platform.asphttp://msdn.microsoft.com/developer/sdk/platform.asp
Platt, Platt, Understanding COM+Understanding COM+. Microsoft . Microsoft Press, 1999. Press, 1999.
DCOM mailing listDCOM mailing list http://msdn.microsoft.com/workshop/essentials/mail.asphttp://msdn.microsoft.com/workshop/essentials/mail.asp