Poco::Data

class SessionImpl

Library: Data
Package: DataCore
Header: Poco/Data/SessionImpl.h

Description

Interface for Session functionality that subclasses must extend. SessionImpl objects are noncopyable.

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Known Derived Classes: AbstractSessionImpl, PooledSessionImpl

Member Summary

Member Functions: begin, canTransact, close, commit, connectionString, connectorName, createStatementImpl, getConnectionTimeout, getFeature, getLoginTimeout, getProperty, getTransactionIsolation, hasTransactionIsolation, isConnected, isTransaction, isTransactionIsolation, open, reconnect, rollback, setConnectionString, setConnectionTimeout, setFeature, setLoginTimeout, setProperty, setTransactionIsolation, uri

Inherited Functions: duplicate, referenceCount, release

Constructors

SessionImpl

SessionImpl(
    const std::string & connectionString,
    std::size_t timeout = LOGIN_TIMEOUT_DEFAULT
);

Creates the SessionImpl.

Destructor

~SessionImpl virtual

virtual ~SessionImpl();

Destroys the SessionImpl.

Member Functions

begin virtual

virtual void begin() = 0;

Starts a transaction.

canTransact virtual

virtual bool canTransact() = 0;

Returns true if session has transaction capabilities.

close virtual

virtual void close() = 0;

Closes the connection.

commit virtual

virtual void commit() = 0;

Commits and ends a transaction.

connectionString inline

const std::string & connectionString() const;

Returns the connection string.

connectorName virtual

virtual const std::string & connectorName() const = 0;

Returns the name of the connector.

createStatementImpl virtual

virtual StatementImpl * createStatementImpl() = 0;

Creates a StatementImpl.

getConnectionTimeout virtual

virtual std::size_t getConnectionTimeout() = 0;

Returns the session connection timeout value.

getFeature virtual

virtual bool getFeature(
    const std::string & name
) = 0;

Look up the state of a feature.

Features are a generic extension mechanism for session implementations. and are defined by the underlying SessionImpl instance.

Throws a NotSupportedException if the requested feature is not supported by the underlying implementation.

getLoginTimeout inline

std::size_t getLoginTimeout() const;

Returns the session login timeout value.

getProperty virtual

virtual Poco::Any getProperty(
    const std::string & name
) = 0;

Look up the value of a property.

Properties are a generic extension mechanism for session implementations. and are defined by the underlying SessionImpl instance.

Throws a NotSupportedException if the requested property is not supported by the underlying implementation.

getTransactionIsolation virtual

virtual Poco::UInt32 getTransactionIsolation() = 0;

Returns the transaction isolation level.

hasTransactionIsolation virtual

virtual bool hasTransactionIsolation(
    Poco::UInt32
) = 0;

Returns true if and only if the transaction isolation level corresponding to the supplied bitmask is supported.

isConnected virtual

virtual bool isConnected() = 0;

Returns true if session is connected, false otherwise.

isTransaction virtual

virtual bool isTransaction() = 0;

Returns true if and only if a transaction is a transaction is in progress, false otherwise.

isTransactionIsolation virtual

virtual bool isTransactionIsolation(
    Poco::UInt32
) = 0;

Returns true if and only if the transaction isolation level corresponds to the supplied bitmask.

open virtual

virtual void open(
    const std::string & connectionString = ""
) = 0;

Opens the session using the supplied string. Can also be used with default empty string to reconnect a disconnected session. If the connection is not established within requested timeout (specified in seconds), a ConnectionFailedException is thrown. Zero timout means indefinite

reconnect

void reconnect();

Closes the connection and opens it again.

rollback virtual

virtual void rollback() = 0;

Aborts a transaction.

setConnectionTimeout virtual

virtual void setConnectionTimeout(
    std::size_t timeout
) = 0;

Sets the session connection timeout value.

setFeature virtual

virtual void setFeature(
    const std::string & name,
    bool state
) = 0;

Set the state of a feature.

Features are a generic extension mechanism for session implementations. and are defined by the underlying SessionImpl instance.

Throws a NotSupportedException if the requested feature is not supported by the underlying implementation.

setLoginTimeout inline

void setLoginTimeout(
    std::size_t timeout
);

Sets the session login timeout value.

setProperty virtual

virtual void setProperty(
    const std::string & name,
    const Poco::Any & value
) = 0;

Set the value of a property.

Properties are a generic extension mechanism for session implementations. and are defined by the underlying SessionImpl instance.

Throws a NotSupportedException if the requested property is not supported by the underlying implementation.

setTransactionIsolation virtual

virtual void setTransactionIsolation(
    Poco::UInt32
) = 0;

Sets the transaction isolation level.

uri static inline

static std::string uri(
    const std::string & connector,
    const std::string & connectionString
);

Returns formatted URI.

uri

std::string uri() const;

Returns the URI for this session.

setConnectionString protected

void setConnectionString(
    const std::string & connectionString
);

Sets the connection string. Should only be called on disconnetced sessions. Throws InvalidAccessException when called on a connected session.

Variables

CONNECTION_TIMEOUT_DEFAULT static

static const std::size_t CONNECTION_TIMEOUT_DEFAULT = CONNECTION_TIMEOUT_INFINITE;

Default connection/login timeout in seconds.

CONNECTION_TIMEOUT_INFINITE static

static const std::size_t CONNECTION_TIMEOUT_INFINITE = 0;

Infinite connection/login timeout.

LOGIN_TIMEOUT_DEFAULT static

static const std::size_t LOGIN_TIMEOUT_DEFAULT = 60;

Default connection/login timeout in seconds.

LOGIN_TIMEOUT_INFINITE static

static const std::size_t LOGIN_TIMEOUT_INFINITE = 0;

Infinite connection/login timeout.