Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::OCI::Server Class Referencefinal

A server handle represents a connection between the client application and the Oracle database server. More...

#include <HOCI.h>

Inheritance diagram for Harlinn::OCI::Server:
[legend]
Collaboration diagram for Harlinn::OCI::Server:
[legend]

Public Member Functions

constexpr Server () noexcept
 
 Server (const OCI::Environment &environment, void *ociserver, bool ownsHandle)
 Constructs a new Server object.
 
 Server (const Server &other)=delete
 
constexpr Server (Server &&other) noexcept
 
Serveroperator= (const Server &other)=delete
 
Serveroperator= (Server &&other) noexcept
 
constexpr void swap (Server &other) noexcept
 
const OCI::EnvironmentEnvironment () const
 
const OCI::ErrorHandleError () const noexcept final override
 Provides access to the OCIError that will be used for OCI calls for this object.
 
HO_EXPORT void Attach (const wchar_t *databaseLink, size_t databaseLinkLength, ServerAttachMode attachMode=ServerAttachMode::Default) const
 
template<WideStringLike StringT>
void Attach (const StringT &databaseLink, ServerAttachMode attachMode=ServerAttachMode::Default) const
 
HO_EXPORT void Detach () const
 
HO_EXPORT ServiceContext CreateServiceContext () const
 
HO_EXPORT ServiceContext CreateServiceContext (const wchar_t *username, size_t usernameLength, const wchar_t *password, size_t passwordLength, const wchar_t *databaseLink, size_t databaseLinkLength, ServerAttachMode attachMode=ServerAttachMode::Default) const
 
template<WideStringLike StringT1, WideStringLike StringT2, WideStringLike StringT3>
ServiceContext CreateServiceContext (const StringT1 &username, const StringT2 &password, const StringT3 &databaseLink, ServerAttachMode attachMode=ServerAttachMode::Default) const
 
template<WideStringLike StringT = WideString>
StringT ExternalName () const
 The external name is the user-friendly global name stored in sys.props$.value$, where name = 'GLOBAL_DB_NAME'. It is not guaranteed to be unique unless all databases register their names with a network directory service.
 
template<WideStringLike StringT>
void SetExternalName (const StringT &externalName) const
 
OCI::FailoverCallbackFailoverCallback () const
 
void SetFailoverCallback (OCI::FailoverCallback *failoverCallback) const
 
template<WideStringLike StringT = WideString>
StringT InternalName () const
 
template<WideStringLike StringT>
void SetInternalName (const StringT &internalName) const
 
bool Oracle8Mode () const
 
bool NonBlocingMode () const
 
void SetNonBlocingMode (bool nonBlocingMode) const
 
template<WideStringLike StringT = WideString>
StringT ServerGroup () const
 An alpha-numeric string not exceeding 30 characters specifying the server group.
 
template<WideStringLike StringT>
void SetServerGroup (const StringT &serverGroup) const
 An alpha-numeric string not exceeding 30 characters specifying the server group.
 
UInt32 ServerStatus () const
 Returns the current status of the server handle. Values are: 1 - There is an active connection to the server. It means that the last call on the connection went through.There is no guarantee that the next call will go through. 0 - There is no connection to the server.
 
bool Connected () const
 Returns true if there is an active connection to the server.
 
template<WideStringLike StringT = WideString>
StringT DbDomain () const
 
template<WideStringLike StringT = WideString>
StringT DbName () const
 
template<WideStringLike StringT = WideString>
StringT InstanceName () const
 
DateTime InstanceStartTime () const
 
template<WideStringLike StringT = WideString>
StringT ServiceName () const
 
- Public Member Functions inherited from Harlinn::OCI::HandleBase
constexpr void * Handle () const noexcept
 Provides access to the value of the handle object.
 
constexpr operator bool () const noexcept
 Test if the handle value is assigned.
 
constexpr bool IsValid () const noexcept
 Test if the handle value is assigned.
 
constexpr OCI::HandleType HandleType () const noexcept
 Returns a value identifying the type of the wrapped handle object.
 

Static Public Attributes

static constexpr OCI::HandleType OCIHandleType = OCI::HandleType::Server
 

Private Types

using Base = HandleBase
 

Private Attributes

const Environmentenvironment_
 
OCI::ErrorHandle error_
 

Additional Inherited Members

- Protected Member Functions inherited from Harlinn::OCI::HandleBase
constexpr HandleBase () noexcept
 Default constructor.
 
constexpr HandleBase (OCI::HandleType handleType, void *handle, bool ownsHandle) noexcept
 Constructs a new HandleBase object.
 
 HandleBase (const HandleBase &other)=delete
 
constexpr HandleBase (HandleBase &&other) noexcept
 Move constructor.
 
virtual ~HandleBase ()
 Destructor.
 
constexpr void SetHandle (void *newHandleValue, bool ownsHandle) noexcept
 Assigns the handle value and ownership to this object.
 
constexpr bool OwnsHandle () const noexcept
 Returns true if this object is the owner of the handle value.
 
void * DetachHandle ()
 If this object is the owner of a handle this function rescinds that ownership, and returns the handle value without closing the handle.
 
void DestroyHandle ()
 Destroys the handle if it is owned by this object.
 
HandleBaseoperator= (const HandleBase &other)=delete
 
constexpr HandleBaseoperator= (HandleBase &&other) noexcept
 
constexpr void swap (HandleBase &other) noexcept
 
template<typename Derived >
constexpr void Take (Derived &&derived) noexcept
 Template function used to implement move assignement in derived classes.
 
void InitializeHandle (void *handle, bool ownsHandle)
 Provides a "safe" mechanism for assigning a handle value. This functions throws if a handle value is already assigned to this object.
 
HO_EXPORT Int32 GetAttribute (void *buffer, UInt32 *size, Attribute attribute) const
 Gets the value of an attribute from the handle.
 
HO_EXPORT Int32 SetAttribute (void *buffer, UInt32 size, Attribute attribute) const
 Sets the value of an attribute on the handle.
 
DateTime GetDateTimeAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a DateTime.
 
void SetDateTimeAttribute (Attribute attribute, const DateTime &value) const
 Sets the value of an attribute on the handle as a DateTime.
 
template<WideStringLike StringT = WideString>
StringT GetStringAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a WideString.
 
template<WideStringLike StringT = WideString>
StringT GetStringAttributeFromByteString (Attribute attribute) const
 Gets the value of an attribute from the handle as a WideString For use with attributes that are not returned as UTF-16.
 
template<WideStringLike StringT>
void SetStringAttribute (Attribute attribute, const StringT &value) const
 Sets the value of an attribute on the handle as a WideString.
 
void SetStringAttribute (Attribute attribute, const wchar_t *value, size_t valueLength) const
 
bool GetBooleanAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a bool.
 
void SetBooleanAttribute (Attribute attribute, bool value) const
 Sets the value of an attribute on the handle as a bool.
 
Byte GetByteAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a Byte.
 
void SetByteAttribute (Attribute attribute, Byte value) const
 Sets the value of an attribute on the handle as a Byte.
 
SByte GetSByteAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a SByte.
 
void SetSByteAttribute (Attribute attribute, SByte value) const
 Sets the value of an attribute on the handle as a Byte.
 
Int16 GetInt16Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an Int16.
 
void SetInt16Attribute (Attribute attribute, Int16 value) const
 Sets the value of an attribute on the handle as an Int16.
 
UInt16 GetUInt16Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an UInt16.
 
void SetUInt16Attribute (Attribute attribute, UInt16 value) const
 Sets the value of an attribute on the handle as an UInt16.
 
Int32 GetInt32Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an Int32.
 
void SetInt32Attribute (Attribute attribute, Int32 value) const
 Sets the value of an attribute on the handle as an Int32.
 
UInt32 GetUInt32Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an UInt32.
 
void SetUInt32Attribute (Attribute attribute, UInt32 value) const
 Sets the value of an attribute on the handle as an UInt32.
 
Int64 GetInt64Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an Int64.
 
void SetInt64Attribute (Attribute attribute, Int64 value) const
 Sets the value of an attribute on the handle as an Int64.
 
UInt64 GetUInt64Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an UInt64.
 
void SetUInt64Attribute (Attribute attribute, UInt64 value) const
 Sets the value of an attribute on the handle as an UInt64.
 
void * GetPointerAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a pointer.
 
void SetPointerAttribute (Attribute attribute, void *value) const
 Sets the value of an attribute on the handle as a pointer.
 
OCI::NumberGetNumberAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a pointer to an OCI::Number.
 
- Static Protected Member Functions inherited from Harlinn::OCI::HandleBase
static HO_EXPORT void HandleFree (void *handle, OCI::HandleType handleType) noexcept
 Calls OCIHandleFree to release the handle.
 

Detailed Description

A server handle represents a connection between the client application and the Oracle database server.

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ Server() [1/4]

Harlinn::OCI::Server::Server ( )
inlineconstexprnoexcept

◆ Server() [2/4]

Harlinn::OCI::Server::Server ( const OCI::Environment & environment,
void * ociserver,
bool ownsHandle )
inline

Constructs a new Server object.

Parameters
environmentA reference to the environment used to create the server handle
handleThe handle wrapped by this object.
ownsHandleSet to true if the new object will take owneship of the handle value

◆ Server() [3/4]

Harlinn::OCI::Server::Server ( const Server & other)
delete

◆ Server() [4/4]

Harlinn::OCI::Server::Server ( Server && other)
inlineconstexprnoexcept

Member Function Documentation

◆ Attach() [1/2]

template<WideStringLike StringT>
void Harlinn::OCI::Server::Attach ( const StringT & databaseLink,
ServerAttachMode attachMode = ServerAttachMode::Default ) const
inline

◆ Attach() [2/2]

void Harlinn::OCI::Server::Attach ( const wchar_t * databaseLink,
size_t databaseLinkLength,
ServerAttachMode attachMode = ServerAttachMode::Default ) const

◆ Connected()

bool Harlinn::OCI::Server::Connected ( ) const
inline

Returns true if there is an active connection to the server.

Returns
true if there is an active connection to the server.

◆ CreateServiceContext() [1/3]

ServiceContext Harlinn::OCI::Server::CreateServiceContext ( ) const

◆ CreateServiceContext() [2/3]

template<WideStringLike StringT1, WideStringLike StringT2, WideStringLike StringT3>
ServiceContext Harlinn::OCI::Server::CreateServiceContext ( const StringT1 & username,
const StringT2 & password,
const StringT3 & databaseLink,
ServerAttachMode attachMode = ServerAttachMode::Default ) const
inline

◆ CreateServiceContext() [3/3]

ServiceContext Harlinn::OCI::Server::CreateServiceContext ( const wchar_t * username,
size_t usernameLength,
const wchar_t * password,
size_t passwordLength,
const wchar_t * databaseLink,
size_t databaseLinkLength,
ServerAttachMode attachMode = ServerAttachMode::Default ) const

◆ DbDomain()

template<WideStringLike StringT = WideString>
StringT Harlinn::OCI::Server::DbDomain ( ) const
inline

◆ DbName()

template<WideStringLike StringT = WideString>
StringT Harlinn::OCI::Server::DbName ( ) const
inline

◆ Detach()

void Harlinn::OCI::Server::Detach ( ) const

◆ Environment()

const OCI::Environment & Harlinn::OCI::Server::Environment ( ) const
inline

◆ Error()

const OCI::ErrorHandle & Harlinn::OCI::Server::Error ( ) const
inlinefinaloverridevirtualnoexcept

Provides access to the OCIError that will be used for OCI calls for this object.

Returns

Implements Harlinn::OCI::HandleBase.

◆ ExternalName()

template<WideStringLike StringT = WideString>
StringT Harlinn::OCI::Server::ExternalName ( ) const
inline

The external name is the user-friendly global name stored in sys.props$.value$, where name = 'GLOBAL_DB_NAME'. It is not guaranteed to be unique unless all databases register their names with a network directory service.

Database names can be exchanged with the server in case of distributed transaction coordination.Server database names can only be accessed if the database is open at the time the OCISessionBegin( ) call is issued.

◆ FailoverCallback()

OCI::FailoverCallback * Harlinn::OCI::Server::FailoverCallback ( ) const
inline

Application failover callbacks can be used in the event of the failure of one database instance, and failover to another instance. Because of the delay which can occur during failover, the application developer may want to inform the user that failover is in progress, and request that the user stand by. Additionally, the session on the initial instance may have received some ALTER SESSION commands. These will not be automatically replayed on the second instance. Consequently, the developer may wish to replay these ALTER SESSION commands on the second instance.

To address the problems described above, the application developer can register a failover callback function. In the event of failover, the callback function is invoked several times during the course of reestablishing the user's session.

The first call to the callback function occurs when Oracle first detects an instance connection loss.This callback is intended to allow the application to inform the user of an upcoming delay.If failover is successful, a second call to the callback function occurs when the connection is reestablished and usable.At this time the client may wish to replay ALTER SESSION commands and inform the user that failover has happened.If failover is unsuccessful, then the callback is called to inform the application that failover will not take place. Additionally, the callback is called each time a user handle besides the primary handle is reauthenticated on the new connection.Since each user handle represents a server - side session, the client may wish to replay ALTER SESSION commands for that session.

Returns

◆ InstanceName()

template<WideStringLike StringT = WideString>
StringT Harlinn::OCI::Server::InstanceName ( ) const
inline

◆ InstanceStartTime()

DateTime Harlinn::OCI::Server::InstanceStartTime ( ) const
inline

◆ InternalName()

template<WideStringLike StringT = WideString>
StringT Harlinn::OCI::Server::InternalName ( ) const
inline

Sets the client database name that will be recorded when performing global transactions. The name can be used by the DBA to track transactions that may be pending in a prepared state due to failures.

◆ NonBlocingMode()

bool Harlinn::OCI::Server::NonBlocingMode ( ) const
inline

This attribute determines the blocking mode. When read, the attribute value returns TRUE if the server context is in nonblocking mode.When set, it toggles the nonblocking mode attribute.

◆ operator=() [1/2]

Server & Harlinn::OCI::Server::operator= ( const Server & other)
delete

◆ operator=() [2/2]

Server & Harlinn::OCI::Server::operator= ( Server && other)
inlinenoexcept

◆ Oracle8Mode()

bool Harlinn::OCI::Server::Oracle8Mode ( ) const
inline

Allows you to determine whether an application has switched to Oracle release 7 mode (for example, through an OCISvcCtxToLda() call). A nonzero (TRUE) return value indicates that the application is currently running in Oracle release 8 mode, a zero (FALSE) return value indicates that the application is currently running in Oracle release 7 mode.

◆ ServerGroup()

template<WideStringLike StringT = WideString>
StringT Harlinn::OCI::Server::ServerGroup ( ) const
inline

An alpha-numeric string not exceeding 30 characters specifying the server group.

◆ ServerStatus()

UInt32 Harlinn::OCI::Server::ServerStatus ( ) const
inline

Returns the current status of the server handle. Values are: 1 - There is an active connection to the server. It means that the last call on the connection went through.There is no guarantee that the next call will go through. 0 - There is no connection to the server.

◆ ServiceName()

template<WideStringLike StringT = WideString>
StringT Harlinn::OCI::Server::ServiceName ( ) const
inline

◆ SetExternalName()

template<WideStringLike StringT>
void Harlinn::OCI::Server::SetExternalName ( const StringT & externalName) const
inline

◆ SetFailoverCallback()

void Harlinn::OCI::Server::SetFailoverCallback ( OCI::FailoverCallback * failoverCallback) const
inline

◆ SetInternalName()

template<WideStringLike StringT>
void Harlinn::OCI::Server::SetInternalName ( const StringT & internalName) const
inline

◆ SetNonBlocingMode()

void Harlinn::OCI::Server::SetNonBlocingMode ( bool nonBlocingMode) const
inline

◆ SetServerGroup()

template<WideStringLike StringT>
void Harlinn::OCI::Server::SetServerGroup ( const StringT & serverGroup) const
inline

An alpha-numeric string not exceeding 30 characters specifying the server group.

◆ swap()

void Harlinn::OCI::Server::swap ( Server & other)
inlineconstexprnoexcept

Member Data Documentation

◆ environment_

const Environment* Harlinn::OCI::Server::environment_
private

◆ error_

OCI::ErrorHandle Harlinn::OCI::Server::error_
private

◆ OCIHandleType

OCI::HandleType Harlinn::OCI::Server::OCIHandleType = OCI::HandleType::Server
staticconstexpr

The documentation for this class was generated from the following files: