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
- DataGridPageChangedEventArgs.cs
- XmlDataLoader.cs
- DataMemberFieldEditor.cs
- MultipleViewProviderWrapper.cs
- EnvelopedPkcs7.cs
- XmlSchemaGroupRef.cs
- GestureRecognizer.cs
- SafeHandle.cs
- ThrowHelper.cs
- PrivacyNoticeBindingElement.cs
- SafeNativeMethodsCLR.cs
- RSAOAEPKeyExchangeDeformatter.cs
- InheritedPropertyChangedEventArgs.cs
- TouchesOverProperty.cs
- TreeNodeSelectionProcessor.cs
- DelegatingConfigHost.cs
- ArrangedElementCollection.cs
- PersianCalendar.cs
- CodeBlockBuilder.cs
- SqlDataSourceConnectionPanel.cs
- Scheduler.cs
- BitmapEffectGeneralTransform.cs
- DiscoveryInnerClientAdhocCD1.cs
- ListViewSelectEventArgs.cs
- DesignBindingConverter.cs
- QueryCacheEntry.cs
- AppDomainManager.cs
- _StreamFramer.cs
- MailAddress.cs
- XmlDeclaration.cs
- ColumnMapCopier.cs
- ColorConvertedBitmapExtension.cs
- DesignTableCollection.cs
- BrowserCapabilitiesCompiler.cs
- WsatAdminException.cs
- CreateParams.cs
- PreviewPrintController.cs
- Pen.cs
- TimeBoundedCache.cs
- PersonalizationDictionary.cs
- ValidationErrorCollection.cs
- TrackingMemoryStreamFactory.cs
- CodeExpressionRuleDeclaration.cs
- RemotingConfiguration.cs
- BrushValueSerializer.cs
- Point3DCollection.cs
- ISessionStateStore.cs
- UIElement.cs
- DesignerVerbCollection.cs
- CreateParams.cs
- PageCodeDomTreeGenerator.cs
- AppliedDeviceFiltersDialog.cs
- PenThreadWorker.cs
- HtmlInputControl.cs
- TableDetailsCollection.cs
- SecurityUtils.cs
- VirtualizingStackPanel.cs
- Dynamic.cs
- PointHitTestParameters.cs
- FunctionQuery.cs
- CreateUserWizard.cs
- IndentedWriter.cs
- FileVersion.cs
- XmlKeywords.cs
- Annotation.cs
- TextContainerChangedEventArgs.cs
- SchemaTypeEmitter.cs
- SoapSchemaMember.cs
- FeatureSupport.cs
- Scripts.cs
- CodeSubDirectoriesCollection.cs
- TemplateApplicationHelper.cs
- GeneralTransform3DGroup.cs
- SettingsAttributeDictionary.cs
- AppDomainAttributes.cs
- WebPartZone.cs
- DrawTreeNodeEventArgs.cs
- CustomValidator.cs
- SslStream.cs
- ResourceSet.cs
- BooleanProjectedSlot.cs
- BitmapEffect.cs
- DockProviderWrapper.cs
- QueryExpression.cs
- AnonymousIdentificationModule.cs
- MembershipUser.cs
- CombinedGeometry.cs
- _SslStream.cs
- ByteAnimationUsingKeyFrames.cs
- DataRowChangeEvent.cs
- WindowsScrollBar.cs
- counter.cs
- MetadataArtifactLoaderCompositeFile.cs
- WindowsRegion.cs
- RelationshipConstraintValidator.cs
- EnumBuilder.cs
- DatatypeImplementation.cs
- SafeHandles.cs
- ListViewTableRow.cs
- ConnectionInterfaceCollection.cs