23 #include "ocilibcpp/types.hpp" 38 Acquire(pSubcription,
nullptr,
nullptr,
nullptr);
44 static_cast<POCI_NOTIFY> (handler !=
nullptr ? Environment::NotifyHandler :
nullptr), port, timeout)),
47 Environment::SetUserCallback<Subscription::NotifyHandlerProc>(
static_cast<OCI_Subscription*
>(*this), handler);
52 Environment::SetUserCallback<Subscription::NotifyHandlerProc>(
static_cast<OCI_Subscription*
>(*this),
nullptr);
OCI_SYM_PUBLIC boolean OCI_API OCI_SubscriptionAddStatement(OCI_Subscription *sub, OCI_Statement *stmt)
Add a statement to the notification to monitor.
unsigned int GetPort() const
Return the port used by the notification.
ostring GetName() const
Return the name of the given registered subscription.
OCI_SYM_PUBLIC OCI_Subscription *OCI_API OCI_SubscriptionRegister(OCI_Connection *con, const otext *name, unsigned int type, POCI_NOTIFY handler, unsigned int port, unsigned int timeout)
Register a notification against the given database.
Subscription()
Default constructor.
Object used for executing SQL or PL/SQL statement and returning the produced results.
A connection or session with a specific database.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
void Register(const Connection &connection, const ostring &name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port=0, unsigned int timeout=0)
Register a notification against the given database.
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
Template Flags template class providing some type safety to some extends for manipulating flags set v...
OCI_SYM_PUBLIC const otext *OCI_API OCI_SubscriptionGetName(OCI_Subscription *sub)
Return the name of the given registered subscription.
OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_SubscriptionGetConnection(OCI_Subscription *sub)
Return the connection handle associated with a subscription handle.
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
void(* NotifyHandlerProc)(Event &evt)
User callback for subscriptions event notifications.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_SubscriptionGetTimeout(OCI_Subscription *sub)
Return the timeout of the given registered subscription.
void(* POCI_NOTIFY)(OCI_Event *event)
Database Change Notification User callback prototype.
unsigned int GetTimeout() const
Return the timeout of the given registered subscription.
Connection GetConnection() const
Return the connection associated with a subscription handle.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_SubscriptionGetPort(OCI_Subscription *sub)
Return the port used by the notification.
OCI_SYM_PUBLIC boolean OCI_API OCI_SubscriptionUnregister(OCI_Subscription *sub)
Unregister a previously registered notification.
void Watch(const ostring &sql)
Add a SQL query to monitor.
void Execute(const ostring &sql)
Prepare and execute a SQL statement or PL/SQL block.
void Unregister()
Unregister a previously registered notification.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...