Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- SecurityTokenAuthenticator.cs
- TransformerTypeCollection.cs
- SecurityContext.cs
- CodeSnippetStatement.cs
- CustomAttributeFormatException.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- IsolatedStorageFileStream.cs
- ButtonBaseAdapter.cs
- StreamHelper.cs
- VerticalAlignConverter.cs
- ConnectionManagementElement.cs
- ColorTransformHelper.cs
- DBSchemaRow.cs
- XhtmlBasicListAdapter.cs
- ImportCatalogPart.cs
- WebRequestModuleElement.cs
- MultipartContentParser.cs
- QueryableDataSourceHelper.cs
- Transform3D.cs
- MemberAccessException.cs
- FileIOPermission.cs
- BitmapEffectvisualstate.cs
- EpmSourceTree.cs
- Globals.cs
- Point3DAnimationUsingKeyFrames.cs
- LinqMaximalSubtreeNominator.cs
- XPathNodeIterator.cs
- CompositeActivityMarkupSerializer.cs
- FontCacheUtil.cs
- HttpModuleActionCollection.cs
- ConfigLoader.cs
- StrongNamePublicKeyBlob.cs
- PathNode.cs
- GridViewItemAutomationPeer.cs
- ContainerUIElement3D.cs
- RecordBuilder.cs
- BindingNavigator.cs
- Mapping.cs
- GridItemCollection.cs
- CoTaskMemHandle.cs
- SoapServerMethod.cs
- WmlFormAdapter.cs
- RectAnimationBase.cs
- SoapAttributes.cs
- securitycriticaldataformultiplegetandset.cs
- DeadLetterQueue.cs
- Monitor.cs
- SqlDesignerDataSourceView.cs
- KeySplineConverter.cs
- FSWPathEditor.cs
- Setter.cs
- RegexTree.cs
- FatalException.cs
- SmtpReplyReader.cs
- Model3D.cs
- Message.cs
- InternalTypeHelper.cs
- DocumentEventArgs.cs
- InkSerializer.cs
- LoadRetryHandler.cs
- SiteMapDesignerDataSourceView.cs
- PropertyGeneratedEventArgs.cs
- SystemUnicastIPAddressInformation.cs
- SqlAliaser.cs
- UIPermission.cs
- PackageRelationshipCollection.cs
- ListDictionaryInternal.cs
- IItemContainerGenerator.cs
- DetailsViewCommandEventArgs.cs
- SiteMapNodeItemEventArgs.cs
- XmlSchemaSimpleTypeRestriction.cs
- Invariant.cs
- MatrixIndependentAnimationStorage.cs
- RootBrowserWindowProxy.cs
- NameSpaceExtractor.cs
- PointKeyFrameCollection.cs
- PeerNameResolver.cs
- PingOptions.cs
- Rotation3D.cs
- DesignTimeTemplateParser.cs
- ThreadPool.cs
- FormatterServices.cs
- FormatterServices.cs
- activationcontext.cs
- SuppressMessageAttribute.cs
- AxHost.cs
- ActivityFunc.cs
- OletxDependentTransaction.cs
- InfocardClientCredentials.cs
- RegexNode.cs
- ListBoxItemAutomationPeer.cs
- ExceptionHandler.cs
- TextDecoration.cs
- IChannel.cs
- BatchServiceHost.cs
- RectangleGeometry.cs
- ListViewSelectEventArgs.cs
- Point3DAnimationBase.cs
- DbConnectionInternal.cs
- ReadOnlyHierarchicalDataSource.cs