Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / DataOracleClient / System / Data / OracleClient / TempEnvironment.cs / 1 / TempEnvironment.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Data.OracleClient { using System; using System.Diagnostics; using System.Security; using System.Security.Permissions; //--------------------------------------------------------------------- // TempEnvironment // // Temporary Environment, used to get temporary handles so we don't // have to pass the environment handle everywhere. // sealed internal class TempEnvironment { static private OciEnvironmentHandle environmentHandle; static private OciErrorHandle availableErrorHandle; // static private volatile bool isInitialized; static private object locked = new object(); private TempEnvironment() { } static void Initialize() { lock (locked) { if (!isInitialized) { bool unicode = false; OCI.MODE environmentMode = (OCI.MODE.OCI_THREADED | OCI.MODE.OCI_OBJECT); // NOTE: cannot be NO_MUTEX because we might be multi-threaded. OCI.DetermineClientVersion(); //1 #if NEVER if (OCI.ClientVersionAtLeastOracle9i) { unicode = true; environmentMode |= OCI.MODE.OCI_UTF16; } #endif //0 environmentHandle = new OciEnvironmentHandle(environmentMode, unicode); availableErrorHandle = new OciErrorHandle(environmentHandle); isInitialized = true; } } } static internal OciErrorHandle GetErrorHandle() { OracleConnection.VerifyExecutePermission(); if (!isInitialized) { Initialize(); } return availableErrorHandle; // } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Data.OracleClient { using System; using System.Diagnostics; using System.Security; using System.Security.Permissions; //--------------------------------------------------------------------- // TempEnvironment // // Temporary Environment, used to get temporary handles so we don't // have to pass the environment handle everywhere. // sealed internal class TempEnvironment { static private OciEnvironmentHandle environmentHandle; static private OciErrorHandle availableErrorHandle; // static private volatile bool isInitialized; static private object locked = new object(); private TempEnvironment() { } static void Initialize() { lock (locked) { if (!isInitialized) { bool unicode = false; OCI.MODE environmentMode = (OCI.MODE.OCI_THREADED | OCI.MODE.OCI_OBJECT); // NOTE: cannot be NO_MUTEX because we might be multi-threaded. OCI.DetermineClientVersion(); //1 #if NEVER if (OCI.ClientVersionAtLeastOracle9i) { unicode = true; environmentMode |= OCI.MODE.OCI_UTF16; } #endif //0 environmentHandle = new OciEnvironmentHandle(environmentMode, unicode); availableErrorHandle = new OciErrorHandle(environmentHandle); isInitialized = true; } } } static internal OciErrorHandle GetErrorHandle() { OracleConnection.VerifyExecutePermission(); if (!isInitialized) { Initialize(); } return availableErrorHandle; // } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DoubleAnimationUsingPath.cs
- DocumentSequenceHighlightLayer.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- VBIdentifierTrimConverter.cs
- BlurBitmapEffect.cs
- ProfilePropertyNameValidator.cs
- EventRoute.cs
- XmlDataLoader.cs
- SpeechDetectedEventArgs.cs
- DataKey.cs
- OptimizerPatterns.cs
- UIInitializationException.cs
- MailFileEditor.cs
- SchemaLookupTable.cs
- AncestorChangedEventArgs.cs
- IOThreadTimer.cs
- XPathNodePointer.cs
- PropertyValueEditor.cs
- WebPartEditorOkVerb.cs
- CreateUserWizardStep.cs
- Int32CollectionConverter.cs
- SqlDataSourceCache.cs
- RemoteX509Token.cs
- sitestring.cs
- List.cs
- ValueUtilsSmi.cs
- RuleProcessor.cs
- PointAnimationUsingPath.cs
- ScriptingProfileServiceSection.cs
- EntityTransaction.cs
- ServerProtocol.cs
- ProfileSettingsCollection.cs
- StreamReader.cs
- ToolStripDropDownMenu.cs
- AutomationEvent.cs
- ResourceReader.cs
- TextContainerChangedEventArgs.cs
- ClientScriptManagerWrapper.cs
- remotingproxy.cs
- SchemaManager.cs
- SapiRecoContext.cs
- ReadOnlyDictionary.cs
- InheritanceContextHelper.cs
- EntityDataSourceChangingEventArgs.cs
- ImplicitInputBrush.cs
- FormsAuthenticationEventArgs.cs
- TextModifierScope.cs
- DeploymentSection.cs
- ViewLoader.cs
- LogLogRecord.cs
- DynamicControl.cs
- safelink.cs
- DeclarativeExpressionConditionDeclaration.cs
- ColorAnimation.cs
- GenerateTemporaryTargetAssembly.cs
- Menu.cs
- BamlTreeMap.cs
- HandledEventArgs.cs
- RegexWorker.cs
- XmlAtomicValue.cs
- MatrixTransform.cs
- GridViewCancelEditEventArgs.cs
- XmlKeywords.cs
- Cursors.cs
- LoginUtil.cs
- XmlSchemaSimpleTypeRestriction.cs
- ThicknessAnimationBase.cs
- DateTimeFormatInfo.cs
- CodeSnippetStatement.cs
- CharacterString.cs
- GridViewDeleteEventArgs.cs
- Brush.cs
- Propagator.ExtentPlaceholderCreator.cs
- ValidationHelper.cs
- SHA512CryptoServiceProvider.cs
- RenderDataDrawingContext.cs
- FixedSOMGroup.cs
- RectAnimation.cs
- FixedHighlight.cs
- InvalidEnumArgumentException.cs
- ComponentManagerBroker.cs
- LockedBorderGlyph.cs
- TrackingServices.cs
- XmlSchema.cs
- FloaterBaseParaClient.cs
- OutputScope.cs
- ExpressionNormalizer.cs
- DocumentViewer.cs
- DynamicMetaObject.cs
- ForEachAction.cs
- BitmapData.cs
- TypeUsageBuilder.cs
- HttpAsyncResult.cs
- RelationalExpressions.cs
- HttpConfigurationSystem.cs
- MissingFieldException.cs
- Point3DCollection.cs
- StringArrayConverter.cs
- SqlXmlStorage.cs
- Symbol.cs