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
- ThreadStartException.cs
- XmlNamespaceDeclarationsAttribute.cs
- MenuDesigner.cs
- Missing.cs
- QilInvokeEarlyBound.cs
- SymbolTable.cs
- LayoutEvent.cs
- OperationContext.cs
- NamedPipeAppDomainProtocolHandler.cs
- FixedTextPointer.cs
- Rules.cs
- ClientConfigPaths.cs
- XmlExceptionHelper.cs
- ElementNotAvailableException.cs
- DefaultSection.cs
- PermissionToken.cs
- ResourceReferenceKeyNotFoundException.cs
- TabPanel.cs
- MaterialCollection.cs
- SmiSettersStream.cs
- DrawingAttributeSerializer.cs
- PolicyDesigner.cs
- InitializationEventAttribute.cs
- ToolStripSplitButton.cs
- TypeUnloadedException.cs
- SessionKeyExpiredException.cs
- ToolStripDropDownButton.cs
- SQLInt16.cs
- OperationDescription.cs
- DesignerForm.cs
- GridViewAutomationPeer.cs
- DesignerActionGlyph.cs
- HttpListenerResponse.cs
- HtmlButton.cs
- Thread.cs
- NullableFloatSumAggregationOperator.cs
- StyleModeStack.cs
- GrowingArray.cs
- TrackingSection.cs
- ControlBuilder.cs
- SaveFileDialog.cs
- RoleGroup.cs
- ReferencedCollectionType.cs
- AQNBuilder.cs
- TreeNodeBindingCollection.cs
- WindowsSpinner.cs
- LineSegment.cs
- RawStylusActions.cs
- PermissionRequestEvidence.cs
- TemplatedMailWebEventProvider.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- CoTaskMemHandle.cs
- SqlClientMetaDataCollectionNames.cs
- SynchronizedDispatch.cs
- DataGridViewCellStyleChangedEventArgs.cs
- NonDualMessageSecurityOverHttpElement.cs
- DataGridViewSortCompareEventArgs.cs
- HwndSource.cs
- TargetException.cs
- SelectionListDesigner.cs
- ImageSource.cs
- OutputScopeManager.cs
- InfoCardBaseException.cs
- WebPartDisplayModeCancelEventArgs.cs
- InfoCard.cs
- DesignSurface.cs
- WebPartUtil.cs
- TextModifierScope.cs
- SqlDataSourceCache.cs
- TypeDelegator.cs
- XPathItem.cs
- SizeConverter.cs
- XmlSignatureManifest.cs
- ProfileManager.cs
- HttpModuleActionCollection.cs
- SkipStoryboardToFill.cs
- LicFileLicenseProvider.cs
- LinearGradientBrush.cs
- FragmentQueryKB.cs
- NotificationContext.cs
- ListParagraph.cs
- FormView.cs
- VirtualPath.cs
- ConnectionInterfaceCollection.cs
- SectionVisual.cs
- DataServiceQuery.cs
- WindowsComboBox.cs
- QueryOperator.cs
- MembershipValidatePasswordEventArgs.cs
- EventSinkActivityDesigner.cs
- WebEventCodes.cs
- CurrencyManager.cs
- BStrWrapper.cs
- FixedPageStructure.cs
- ImageBrush.cs
- AsnEncodedData.cs
- ObjectPersistData.cs
- BaseParaClient.cs
- SelectionPattern.cs
- CaseInsensitiveComparer.cs