Poco::Data::PostgreSQL

class SessionImpl

File Information

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

Description

Implements SessionImpl interface

Inheritance

Direct Base Classes: Poco::Data::AbstractSessionImpl < SessionImpl >

All Base Classes: Poco::Data::AbstractSessionImpl < SessionImpl >

Member Summary

Member Functions: begin, canTransact, close, commit, connectorName, createStatementImpl, getConnectionTimeout, getTransactionIsolation, handle, hasTransactionIsolation, isAsynchronousCommit, isAutoCommit, isConnected, isTransaction, isTransactionIsolation, open, reset, rollback, setAsynchronousCommit, setAutoCommit, setConnectionTimeout, setTransactionIsolation

Constructors

SessionImpl

SessionImpl(
    const std::string & aConnectionString,
    std::size_t aLoginTimeout = LOGIN_TIMEOUT_DEFAULT
);

Creates the SessionImpl. Opens a connection to the database

Connection string format: <str> == <assignment> | <assignment> ' ' <str> <assignment> == <name> '=' <value> <name> == 'host' | 'port' | 'user' | 'password' | 'dbname' | 'connect_timeout' <value> == [~;]*

consult postgres documentation for other parameters

Destructor

~SessionImpl

~SessionImpl();

Destroys the SessionImpl.

Member Functions

begin

void begin();

Starts a transaction

canTransact inline

bool canTransact() const;

Returns true if session has transaction capabilities.

close

void close();

Closes the connection.

commit

void commit();

Commits and ends a transaction

connectorName inline

const std::string & connectorName() const;

Returns the name of the connector.

createStatementImpl

Poco::Data::StatementImpl::Ptr createStatementImpl();

getConnectionTimeout inline

std::size_t getConnectionTimeout() const;

Returns the session connection timeout value.

getTransactionIsolation

Poco::UInt32 getTransactionIsolation() const;

Returns the transaction isolation level.

handle inline

SessionHandle & handle();

Get handle

hasTransactionIsolation

bool hasTransactionIsolation(
    Poco::UInt32 aTI
) const;

Returns true iff the transaction isolation level corresponding to the supplied bitmask is supported.

isAsynchronousCommit

bool isAsynchronousCommit(
    const std::string & aName = std::string ()
) const;

is the connection in Asynchronous commit mode?

isAutoCommit

bool isAutoCommit(
    const std::string & aName = std::string ()
) const;

Returns autocommit property value.

isConnected

bool isConnected() const;

Returns true if connected, false otherwise.

isTransaction

bool isTransaction() const;

Returns true iff a transaction is a transaction is in progress, false otherwise.

isTransactionIsolation inline

bool isTransactionIsolation(
    Poco::UInt32 aTI
) const;

Returns true iff the transaction isolation level corresponds to the supplied bitmask.

open

void open(
    const std::string & aConnectionString = std::string ()
);

Opens a connection to the database.

reset

void reset();

Do nothing

rollback

void rollback();

Aborts a transaction

setAsynchronousCommit

void setAsynchronousCommit(
    const std::string & param147,
    bool aValue
);

Sets asynchronousCommit property for the session.

setAutoCommit

void setAutoCommit(
    const std::string & param146,
    bool aValue
);

Sets autocommit property for the session.

setConnectionTimeout

void setConnectionTimeout(
    std::size_t aTimeout
);

Sets the session connection timeout value.

setTransactionIsolation

void setTransactionIsolation(
    Poco::UInt32 aTI
);

Sets the transaction isolation level.

Securely control IoT edge devices from anywhere   Connect a Device