Changeset 3218
- Timestamp:
- 06/18/08 22:31:18 (2 months ago)
- Files:
-
- trunk/MgDev/Common/Renderers/AGGRenderer.cpp (modified) (1 diff)
- trunk/MgDev/Common/Renderers/CriticalSection.cpp (added)
- trunk/MgDev/Common/Renderers/CriticalSection.h (added)
- trunk/MgDev/Common/Renderers/DWFRenderer.cpp (modified) (1 diff)
- trunk/MgDev/Common/Renderers/FontManager.cpp (modified) (11 diffs)
- trunk/MgDev/Common/Renderers/FontManager.h (modified) (2 diffs)
- trunk/MgDev/Common/Renderers/Makefile.am (modified) (2 diffs)
- trunk/MgDev/Common/Renderers/Renderers.vcproj (modified) (1 diff)
- trunk/MgDev/Server/src/Common/Cache/FeatureServiceCache.cpp (modified) (17 diffs)
- trunk/MgDev/Server/src/Common/Cache/FeatureServiceCache.h (modified) (2 diffs)
- trunk/MgDev/Server/src/Common/Cache/FeatureServiceCacheEntry.cpp (modified) (6 diffs)
- trunk/MgDev/Server/src/Common/Cache/FeatureServiceCacheEntry.h (modified) (6 diffs)
- trunk/MgDev/Server/src/Common/Manager/CacheManager.cpp (modified) (2 diffs)
- trunk/MgDev/Server/src/Common/Manager/Connection.cpp (modified) (4 diffs)
- trunk/MgDev/Server/src/Common/Manager/Connection.h (modified) (1 diff)
- trunk/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp (modified) (1 diff)
- trunk/MgDev/Server/src/Core/serverconfig.ini (modified) (1 diff)
- trunk/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp (modified) (1 diff)
- trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/MgDev/Common/Renderers/AGGRenderer.cpp
r3206 r3218 1271 1271 double angleRad) 1272 1272 { 1273 if (NULL == font) 1274 { 1275 return; 1276 } 1277 1273 1278 // Don't draw the text if height > 16384 pixels, since memory usage when 1274 1279 // evaluating the glyphs will get too large. 16394 pixels should be trunk/MgDev/Common/Renderers/DWFRenderer.cpp
r3087 r3218 2950 2950 double angleRad) 2951 2951 { 2952 if (NULL == font) 2953 { 2954 return; 2955 } 2956 2952 2957 // draw to the active file if it's set 2953 2958 WT_File* file = m_w2dActive? m_w2dActive : m_w2dFile; trunk/MgDev/Common/Renderers/FontManager.cpp
r3180 r3218 46 46 47 47 // static initializations 48 FontManager FontManager::m_manager; 48 CustomThreadMutex FontManager::sm_mutex; 49 FontManager FontManager::sm_manager; 49 50 50 51 … … 56 57 FontManager::FontManager() 57 58 { 59 AutoMutexLocker autoLocker(sm_mutex); 60 58 61 FT_Init_FreeType(&m_library); // TODO: check error code 59 62 60 m_manager.init_font_list();63 sm_manager.init_font_list(); 61 64 } 62 65 … … 64 67 FontManager::~FontManager() 65 68 { 69 AutoMutexLocker autoLocker(sm_mutex); 70 66 71 FaceMapIterator it; 67 72 FaceMapEntryType* pEntry = NULL; … … 120 125 FontManager* FontManager::Instance() 121 126 { 122 return & m_manager;127 return &sm_manager; 123 128 } 124 129 … … 126 131 int FontManager::get_face(const char* filename, FT_Long index, FT_Face* face) 127 132 { 133 AutoMutexLocker autoLocker(sm_mutex); 134 128 135 int ret = 0; // our return error code 129 136 FaceMapIterator it; // an interator … … 169 176 FaceMapEntryType* FontManager::load_file(const char* filename) 170 177 { 178 AutoMutexLocker autoLocker(sm_mutex); 179 171 180 int errcode = 0; // an error code 172 181 FaceMapEntryType* pEntry = NULL; // pointer to return value … … 214 223 void FontManager::init_font_list() 215 224 { 225 AutoMutexLocker autoLocker(sm_mutex); 226 216 227 int error = 0; 217 228 … … 282 293 void FontManager::init_font_list() 283 294 { 295 AutoMutexLocker autoLocker(sm_mutex); 296 284 297 int error = 0; 285 298 … … 432 445 font->m_underline_thickness = face->underline_thickness; 433 446 447 AutoMutexLocker autoLocker(sm_mutex); 448 434 449 // add the font 435 450 m_fontlist.push_front(font); … … 443 458 { 444 459 if (alias != NULL && asciiName != NULL) 460 { 461 AutoMutexLocker autoLocker(sm_mutex); 462 445 463 m_fontAliases.insert(FontMapPair(new wstring(alias), new wstring(asciiName))); 464 } 446 465 } 447 466 … … 457 476 const RS_Font* FontManager::FindFont(const wstring& sfontname, bool bold, bool italic) 458 477 { 478 AutoMutexLocker autoLocker(sm_mutex); 479 459 480 // first see if we cached the font match so we don't have to iterate 460 481 NameCacheEntry entry = m_matchedCache[sfontname]; trunk/MgDev/Common/Renderers/FontManager.h
r2904 r3218 21 21 #include "Renderers.h" 22 22 #include "RS_Font.h" // for FontList 23 #include "CriticalSection.h" 23 24 24 25 // FreeType includes … … 87 88 map<wstring, NameCacheEntry> m_matchedCache; 88 89 89 static FontManager m_manager; 90 static CustomThreadMutex sm_mutex; 91 static FontManager sm_manager; 90 92 }; 91 93 trunk/MgDev/Common/Renderers/Makefile.am
r2657 r3218 24 24 AGGFillPatterns.cpp \ 25 25 ../../Oem/agg-2.4/font_freetype/agg_font_freetype.cpp \ 26 CriticalSection.cpp \ 26 27 DWFRenderer.cpp \ 27 28 EMapRenderer.cpp \ … … 50 51 AGGW2DRewriter.h \ 51 52 AGGFillPatterns.h \ 53 CriticalSection.h \ 52 54 DWFRenderer.h \ 53 55 DWFRSInputStream.h \ trunk/MgDev/Common/Renderers/Renderers.vcproj
r3208 r3218 687 687 </Filter> 688 688 <File 689 RelativePath=".\CriticalSection.cpp" 690 > 691 </File> 692 <File 693 RelativePath=".\CriticalSection.h" 694 > 695 </File> 696 <File 689 697 RelativePath=".\Renderers.h" 690 698 > trunk/MgDev/Server/src/Common/Cache/FeatureServiceCache.cpp
r3114 r3218 266 266 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 267 267 268 if (NULL != entry.p)269 {270 Ptr<MgFeatureSourceCacheItem> data = entry->GetFeatureSource();271 272 if (NULL != data.p)273 {274 RemoveEntry(resource);275 entry = NULL;276 }277 }278 279 268 if (NULL == entry.p) 280 269 { … … 306 295 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 307 296 308 if (NULL != entry.p)309 {310 Ptr<MgSpatialContextCacheItem> data = entry->GetSpatialContextInfo();311 312 if (NULL != data.p)313 {314 RemoveEntry(resource);315 entry = NULL;316 }317 }318 319 297 if (NULL == entry.p) 320 298 { … … 345 323 346 324 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 347 348 if (NULL != entry.p)349 {350 Ptr<MgSpatialContextReader> data = entry->GetSpatialContextReader();351 352 if (NULL != data.p)353 {354 RemoveEntry(resource);355 entry = NULL;356 }357 }358 325 359 326 if (NULL == entry.p) … … 377 344 data = entry->GetSpatialContextReader(); 378 345 346 // Make sure this cached data is only used by one thread at a time. 379 347 if (NULL != data.p 380 && entry->GetActiveFlag() != active) 348 && (data->GetRefCount() > 2 349 || entry->GetActiveFlag() != active)) 381 350 { 382 351 data = NULL; 383 352 } 384 } 385 386 // Reset the reader387 if(NULL != data.p)388 {389 data->Reset();353 354 // Reset the reader. 355 if (NULL != data.p) 356 { 357 data->Reset(); 358 } 390 359 } 391 360 … … 399 368 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 400 369 401 if (NULL != entry.p)402 {403 Ptr<MgStringCollection> data = entry->GetFeatureSchemaNames();404 405 if (NULL != data.p)406 {407 RemoveEntry(resource);408 entry = NULL;409 }410 }411 412 370 if (NULL == entry.p) 413 371 { … … 433 391 } 434 392 435 void MgFeatureServiceCache::SetFeatureSchemaCollection(MgResourceIdentifier* resource, CREFSTRING featureSchemaName, MgFeatureSchemaCollection* featureSchemaCollection, bool bSerialize) 436 { 437 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex)); 438 439 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 440 441 if (NULL != entry.p) 442 { 443 Ptr<MgFeatureSchemaCollection> data = entry->GetFeatureSchemaCollection(); 444 445 if (NULL != data.p) 446 { 447 RemoveEntry(resource); 448 entry = NULL; 449 } 450 } 393 void MgFeatureServiceCache::SetFeatureSchemaCollection(MgResourceIdentifier* resource, CREFSTRING featureSchemaName, bool serialized, MgFeatureSchemaCollection* featureSchemaCollection) 394 { 395 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex)); 396 397 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 451 398 452 399 if (NULL == entry.p) … … 456 403 457 404 entry->SetFeatureSchemaName(featureSchemaName); 405 entry->SetFeatureSchemaCollectionSerialized(serialized); 458 406 entry->SetFeatureSchemaCollection(featureSchemaCollection); 459 entry->SetFeatureSchemaCollectionSerialized(bSerialize); 460 } 461 462 MgFeatureSchemaCollection* MgFeatureServiceCache::GetFeatureSchemaCollection(MgResourceIdentifier* resource, CREFSTRING featureSchemaName, bool bSerialize) 407 } 408 409 MgFeatureSchemaCollection* MgFeatureServiceCache::GetFeatureSchemaCollection(MgResourceIdentifier* resource, CREFSTRING featureSchemaName, bool serialized) 463 410 { 464 411 ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, NULL)); … … 471 418 data = entry->GetFeatureSchemaCollection(); 472 419 473 // Skip this cached entry if requested different feature schema,474 // or requested schema with serialized XML and cached schema not serialized.475 420 if (NULL != data.p 476 && (entry->GetFeatureSchemaName() != featureSchemaName ||477 (!entry->GetFeatureSchemaCollectionSerialized()) && bSerialize))421 && (entry->GetFeatureSchemaName() != featureSchemaName 422 || entry->GetFeatureSchemaCollectionSerialized() != serialized)) 478 423 479 424 { … … 490 435 491 436 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 492 493 if (NULL != entry.p)494 {495 STRING data = entry->GetFeatureSchemaXml();496 497 if (!data.empty())498 {499 RemoveEntry(resource);500 entry = NULL;501 }502 }503 437 504 438 if (NULL == entry.p) … … 538 472 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 539 473 540 if (NULL != entry.p)541 {542 Ptr<MgStringCollection> data = entry->GetFeatureClassNames();543 544 if (NULL != data.p)545 {546 RemoveEntry(resource);547 entry = NULL;548 }549 }550 551 474 if (NULL == entry.p) 552 475 { … … 584 507 585 508 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 586 587 if (NULL != entry.p)588 {589 Ptr<MgClassDefinition> data = entry->GetFeatureClassDefinition();590 591 if (NULL != data.p)592 {593 RemoveEntry(resource);594 entry = NULL;595 }596 }597 509 598 510 if (NULL == entry.p) … … 617 529 data = entry->GetFeatureClassDefinition(); 618 530 619 if ( NULL != data.p && 620 (entry->GetFeatureSchemaName() != featureSchemaName || entry->GetFeatureClassName() != featureClassName) ) 531 if (NULL != data.p 532 && (entry->GetFeatureSchemaName() != featureSchemaName 533 || entry->GetFeatureClassName() != featureClassName)) 621 534 { 622 535 data = NULL; … … 632 545 633 546 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 634 635 if (NULL != entry.p)636 {637 if (entry->GetFeatureSchemaName() != featureSchemaName)638 {639 RemoveEntry(resource);640 entry = NULL;641 }642 else if (entry->GetFeatureClassName() != featureClassName)643 {644 entry->SetFeatureClassDefinition((MgClassDefinition*) NULL);645 }646 }647 547 648 548 if (NULL == entry.p) … … 669 569 if (NULL != data.p 670 570 && (entry->GetFeatureSchemaName() != featureSchemaName 671 || entry->GetFeatureClassName() != featureClassName))571 || entry->GetFeatureClassName() != featureClassName)) 672 572 { 673 573 data = NULL; … … 693 593 Ptr<MgFeatureServiceCacheEntry> entry = GetEntry(resource); 694 594 695 if (NULL != entry.p)696 {697 FdoPtr<FdoFeatureSchemaCollection> data = entry->GetFdoFeatureSchemaCollection();698 699 if (NULL != data.p)700 {701 RemoveEntry(resource);702 entry = NULL;703 }704 }705 706 595 if (NULL == entry.p) 707 596 { … … 725 614 data = entry->GetFdoFeatureSchemaCollection(); 726 615 727 // Skip this cached entry if requested different feature schema728 616 if (NULL != data.p 729 && (entry->GetFeatureSchemaName() != featureSchemaName)) 730 617 && entry->GetFeatureSchemaName() != featureSchemaName) 731 618 { 732 619 data = NULL; 733 620 } 621 622 // Make sure this cached data is only used by one thread at a time. 734 623 if (NULL != data.p) 735 624 { … … 745 634 return data.Detach(); 746 635 } 747 748 trunk/MgDev/Server/src/Common/Cache/FeatureServiceCache.h
r3114 r3218 66 66 MgStringCollection* GetFeatureSchemaNames(MgResourceIdentifier* resource); 67 67 68 void SetFeatureSchemaCollection(MgResourceIdentifier* resource, CREFSTRING featureSchemaName, MgFeatureSchemaCollection* featureSchemaCollection, bool bSerialize);69 MgFeatureSchemaCollection* GetFeatureSchemaCollection(MgResourceIdentifier* resource, CREFSTRING featureSchemaName, bool bSerialize);68 void SetFeatureSchemaCollection(MgResourceIdentifier* resource, CREFSTRING featureSchemaName, bool serialized, MgFeatureSchemaCollection* featureSchemaCollection); 69 MgFeatureSchemaCollection* GetFeatureSchemaCollection(MgResourceIdentifier* resource, CREFSTRING featureSchemaName, bool serialized); 70 70 71 71 void SetFeatureSchemaXml(MgResourceIdentifier* resource, CREFSTRING featureSchemaName, CREFSTRING featureSchemaXml); … … 96 96 private: 97 97 98 friend class MgCacheManager; 99 98 100 MgFeatureServiceCacheEntries m_featureServiceCacheEntries; 99 101 }; trunk/MgDev/Server/src/Common/Cache/FeatureServiceCacheEntry.cpp
r3090 r3218 24 24 /// 25 25 MgFeatureServiceCacheEntry::MgFeatureServiceCacheEntry() : 26 m_active(false) 26 m_active(false), 27 m_featureSchemaCollectionSerialized(false) 27 28 { 28 29 } … … 67 68 void MgFeatureServiceCacheEntry::SetFeatureSchemaName(CREFSTRING featureSchemaName) 68 69 { 69 if ( featureSchemaName != m_featureSchemaName )70 if (!m_featureSchemaName.empty() && featureSchemaName != m_featureSchemaName) 70 71 { 72 SetFeatureSchemaCollectionSerialized(false); 71 73 SetFeatureSchemaCollection((MgFeatureSchemaCollection*) NULL); 74 SetFdoFeatureSchemaCollection((FdoFeatureSchemaCollection*) NULL); 72 75 SetFeatureSchemaXml(L""); 73 SetFdoFeatureSchemaCollection((FdoFeatureSchemaCollection*) NULL);74 76 SetFeatureClassNames((MgStringCollection*) NULL); 75 77 SetFeatureClassName(L""); … … 77 79 78 80 m_featureSchemaName = featureSchemaName; 79 80 81 } 81 82 82 83 void MgFeatureServiceCacheEntry::SetFeatureClassName(CREFSTRING featureClassName) 83 84 { 84 if ( featureClassName != m_featureClassName )85 if (!m_featureClassName.empty() && featureClassName != m_featureClassName) 85 86 { 86 87 SetFeatureClassDefinition((MgClassDefinition*) NULL); 87 88 SetFeatureClassIdentityProperties((MgPropertyDefinitionCollection*) NULL); 88 89 } 90 89 91 m_featureClassName = featureClassName; 90 92 } … … 110 112 } 111 113 114 void MgFeatureServiceCacheEntry::SetFeatureSchemaCollectionSerialized(bool serialized) 115 { 116 m_featureSchemaCollectionSerialized = serialized; 117 } 118 112 119 void MgFeatureServiceCacheEntry::SetFeatureSchemaCollection(MgFeatureSchemaCollection* featureSchemaCollection) 113 120 { … … 120 127 } 121 128 122 void MgFeatureServiceCacheEntry::SetFeatureSchemaCollectionSerialized(bool bSerialized)123 {124 m_featureSchemaCollectionSerialized = bSerialized;125 }126 127 bool MgFeatureServiceCacheEntry::GetFeatureSchemaCollectionSerialized()128 {129 return m_featureSchemaCollectionSerialized;130 }131 132 129 void MgFeatureServiceCacheEntry::SetFeatureSchemaXml(CREFSTRING featureSchemaXml) 133 130 { 134 131 m_featureSchemaXml = featureSchemaXml; 135 }136 137 STRING MgFeatureServiceCacheEntry::GetFeatureSchemaXml()138 {139 return m_featureSchemaXml;140 132 } 141 133 … … 172 164 void MgFeatureServiceCacheEntry::SetFdoFeatureSchemaCollection(FdoFeatureSchemaCollection* featureSchemaCollection) 173 165 { 174 m_FdoFeatureSchemaCollection = SAFE_ADDREF(featureSchemaCollection); 166 // Note that the caller must ensure this pointer's reference counter is 167 // thread safe when calling this method. 168 m_fdoFeatureSchemaCollection = FDO_SAFE_ADDREF(featureSchemaCollection); 175 169 } 176 170 177 171 FdoFeatureSchemaCollection* MgFeatureServiceCacheEntry::GetFdoFeatureSchemaCollection() 178 172 { 179 return SAFE_ADDREF(m_FdoFeatureSchemaCollection.p); 173 // Note that the caller must ensure this pointer's reference counter is 174 // thread safe when calling this method. 175 return FDO_SAFE_ADDREF(m_fdoFeatureSchemaCollection.p); 180 176 } 181 trunk/MgDev/Server/src/Common/Cache/FeatureServiceCacheEntry.h
r3090 r3218 52 52 bool GetActiveFlag() const; 53 53 54 void SetFeatureSchemaName(CREFSTRING featureSchemaName);55 CREFSTRING GetFeatureSchemaName() const;56 57 void SetFeatureClassName(CREFSTRING featureClassName);58 CREFSTRING GetFeatureClassName() const;59 60 54 MgSpatialContextReader* GetSpatialContextReader(); 61 55 void SetSpatialContextReader(MgSpatialContextReader* spatialContextReader); … … 64 58 void SetFeatureSchemaNames(MgStringCollection* featureSchemaNames); 65 59 60 void SetFeatureSchemaName(CREFSTRING featureSchemaName); 61 STRING GetFeatureSchemaName() const; 62 63 bool GetFeatureSchemaCollectionSerialized() const; 64 void SetFeatureSchemaCollectionSerialized(bool serialized); 65 66 66 MgFeatureSchemaCollection* GetFeatureSchemaCollection(); 67 67 void SetFeatureSchemaCollection(MgFeatureSchemaCollection* featureSchemaCollection); 68 68 69 bool GetFeatureSchemaCollectionSerialized();70 void SetF eatureSchemaCollectionSerialized(bool bSerialized);69 FdoFeatureSchemaCollection* GetFdoFeatureSchemaCollection(); 70 void SetFdoFeatureSchemaCollection(FdoFeatureSchemaCollection* featureSchemaCollection); 71 71 72 STRING GetFeatureSchemaXml() ;72 STRING GetFeatureSchemaXml() const; 73 73 void SetFeatureSchemaXml(CREFSTRING featureSchemaXml); 74 74 75 75 MgStringCollection* GetFeatureClassNames(); 76 76 void SetFeatureClassNames(MgStringCollection* featureClassNames); 77 78 void SetFeatureClassName(CREFSTRING featureClassName); 79 STRING GetFeatureClassName() const; 77 80 78 81 MgClassDefinition* GetFeatureClassDefinition(); … … 81 84 MgPropertyDefinitionCollection* GetFeatureClassIdentityProperties(); 82 85 void SetFeatureClassIdentityProperties(MgPropertyDefinitionCollection* featureClassIdentityProperties); 83 84 FdoFeatureSchemaCollection* GetFdoFeatureSchemaCollection();85 void SetFdoFeatureSchemaCollection(FdoFeatureSchemaCollection* featureSchemaCollection);86 86 87 87 /// Data Members … … 99 99 STRING m_featureSchemaName; 100 100 101 bool m_featureSchemaCollectionSerialized; 101 102 Ptr<MgFeatureSchemaCollection> m_featureSchemaCollection; 102 bool m_featureSchemaCollectionSerialized; 103 104 FdoPtr<FdoFeatureSchemaCollection> m_fdoFeatureSchemaCollection; 105 103 106 STRING m_featureSchemaXml; 104 107 Ptr<MgStringCollection> m_featureClassNames; … … 108 111 Ptr<MgClassDefinition> m_featureClassDefinition; 109 112 Ptr<MgPropertyDefinitionCollection> m_featureClassIdentityProperties; 110 111 FdoPtr<FdoFeatureSchemaCollection> m_FdoFeatureSchemaCollection;112 113 }; 113 114 … … 119 120 } 120 121 121 inline CREFSTRING MgFeatureServiceCacheEntry::GetFeatureSchemaName() const122 inline STRING MgFeatureServiceCacheEntry::GetFeatureSchemaName() const 122 123 { 123 124 return m_featureSchemaName; 124 125 } 125 126 126 inline CREFSTRING MgFeatureServiceCacheEntry::GetFeatureClassName() const 127 inline bool MgFeatureServiceCacheEntry::GetFeatureSchemaCollectionSerialized() const 128 { 129 return m_featureSchemaCollectionSerialized; 130 } 131 132 inline STRING MgFeatureServiceCacheEntry::GetFeatureSchemaXml() const 133 { 134 return m_featureSchemaXml; 135 } 136 137 inline STRING MgFeatureServiceCacheEntry::GetFeatureClassName() const 127 138 { 128 139 return m_featureClassName; trunk/MgDev/Server/src/Common/Manager/CacheManager.cpp
r2908 r3218 116 116 void MgCacheManager::ClearCaches() 117 117 { 118 // The mutex usage and the method call order here are important 119 // because they ensure all the caches are in sync. 120 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_featureServiceCache.m_mutex)); 121 122 m_fdoConnectionManager->ClearCache(); 118 123 m_featureServiceCache.Clear(); 119 m_fdoConnectionManager->ClearCache();120 124 } 121 125 … … 128 132 if (STRING::npos != resource.rfind(MgResourceType::FeatureSource)) 129 133 { 134 // The mutex usage and the method call order here are important 135 // because they ensure all the caches are in sync. 136 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_featureServiceCache.m_mutex)); 137 138 m_fdoConnectionManager->RemoveCachedFdoConnection(resource); 130 139 m_featureServiceCache.RemoveEntry(resource); 140 } 141 } 142 143 /////////////////////////////////////////////////////////////////////////////// 144 /// \brief 145 /// Notify the applicable caches of the changed resource. 146 /// 147 void MgCacheManager::NotifyResourcesChanged(MgResourceIdentifier* resource) 148 { 149 if (NULL != resource && resource->IsResourceTypeOf(MgResourceType::FeatureSource)) 150 { 151 // The mutex usage and the method call order here are important 152 // because they ensure all the caches are in sync. 153 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_featureServiceCache.m_mutex)); 154 131 155 m_fdoConnectionManager->RemoveCachedFdoConnection(resource); 132 }133 }134 135 ///////////////////////////////////////////////////////////////////////////////136 /// \brief137 /// Notify the applicable caches of the changed resource.138 ///139 void MgCacheManager::NotifyResourcesChanged(MgResourceIdentifier* resource)140 {141 if (NULL != resource && resource->IsResourceTypeOf(MgResourceType::FeatureSource))142 {143 156 m_featureServiceCache.RemoveEntry(resource); 144 m_fdoConnectionManager->RemoveCachedFdoConnection(resource);145 157 } 146 158 } trunk/MgDev/Server/src/Common/Manager/Connection.cpp
r2908 r3218 120 120 void MgConnection::SetBusy() 121 121 { 122 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex)); 123 122 124 m_busy = true; 123 125 } … … 125 127 void MgConnection::ClearBusy() 126 128 { 129 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex)); 130 127 131 m_busy = false; 128 132 } … … 137 141 bool MgConnection::IsExpired(INT32 nIdleTimeout) const 138 142 { 143 ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false)); 144 139 145 bool bExpired = false; 140 146 … … 199 205 void MgConnection::UpdateLastUsageTime() 200 206 { 207 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex)); 208 201 209 m_lastUsageTime = ACE_High_Res_Timer::gettimeofday(); 202 210 } trunk/MgDev/Server/src/Common/Manager/Connection.h
r2908 r3218 95 95 private: 96 96 97 mutable ACE_Recursive_Thread_Mutex m_mutex; 97 98 bool m_busy; 98 99 trunk/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp
r2908 r3218 213 213 if (expiredSessions != NULL) 214 214 { 215 // The mutex usage is to ensure this operation is completed for all expired sessions at once. 216 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, sm_mutex)); 217 215 218 for (INT32 i=0; i<expiredSessions->GetCount(); ++i) 216 219 MgLongTransactionManager::RemoveLongTransactionNames(expiredSessions->GetItem(i)); trunk/MgDev/Server/src/Core/serverconfig.ini
r3118 r3218 256 256 DataConnectionPoolExcludedProviders= OSGeo.SDF,OSGeo.SHP 257 257 DataConnectionPoolSize = 200 258 DataConnectionPoolSizeCustom = OSGeo.Gdal:1 ,Autodesk.Raster:1258 DataConnectionPoolSizeCustom = OSGeo.Gdal:1 259 259 DataConnectionTimeout = 28800 260 260 DataConnectionTimerInterval = 3600 trunk/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp
r3114 r3218 547 547 // The following sets ffsc to NULL 548 548 m_featureServiceCache->SetFdoFeatureSchemaCollection(resource, schemaName, ffsc); 549 m_featureServiceCache->SetFeatureSchemaCollection(resource, schemaName, fsCollection.p, serialize);549 m_featureServiceCache->SetFeatureSchemaCollection(resource, schemaName, serialize, fsCollection.p); 550 550 } 551 551 trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
r3152 r3218 587 587 else if (gl) 588 588 { 589 // TODO: FDO RFP - Make FdoPtr's reference counter thread-safe. 590 static ACE_Recursive_Thread_Mutex sg_fdoRfpMutex; 591 589 592 #ifdef _DEBUG 590 593 long dwLayerStart = GetTickCount(); … … 611 614 612 615 //get a transform from layer coord sys to map coord sys 613 TransformCache* item = TransformCache::GetLayerToMapTransform(transformCache, gl->GetFeatureName(), featResId, dstCs, csFactory, svcFeature); 616 TransformCache* item = NULL; 617 { 618 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, sg_fdoRfpMutex)); 619 item = TransformCache::GetLayerToMapTransform(transformCache, gl->GetFeatureName(), featResId, dstCs, csFactory, svcFeature); 620 } 621 614 622 Ptr<MgCoordinateSystem> layerCs = item? item->GetCoordSys() : NULL; 615 623 MgCSTrans* xformer = item? item->GetTransform() : NULL; … … 670 678 671 679 //perform the raster query 672 rsReader = ExecuteRasterQuery(svcFeature, extent, gl, overrideFilter.c_str(), dstCs, layerCs, width, height); 680 { 681 ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, sg_fdoRfpMutex)); 682 rsReader = ExecuteRasterQuery(svcFeature, extent, gl, overrideFilter.c_str(), dstCs, layerCs, width, height); 683 } 673 684 674 685 if (NULL != rsReader)
