OCILIB (C and C++ Driver for Oracle)  4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
ocilib::Queue Class Reference

Class allowing the administration of Oracle Queues. More...

#include <types.hpp>

Public Types

enum  QueueTypeValues { NormalQueue = OCI_AQT_NORMAL , ExceptionQueue = OCI_AQT_EXCEPTION , NonPersistentQueue = OCI_AQT_NON_PERSISTENT }
 Queue Type enumerated values. More...
 
typedef core::Enum< QueueTypeValuesQueueType
 Queue Type.
 

Static Public Member Functions

static void Create (const Connection &connection, const ostring &queue, const ostring &table, QueueType type=NormalQueue, unsigned int maxRetries=0, unsigned int retryDelay=0, unsigned int retentionTime=0, bool dependencyTracking=false, const ostring &comment=OTEXT(""))
 Create a queue.
 
static void Alter (const Connection &connection, const ostring &queue, unsigned int maxRetries=0, unsigned int retryDelay=0, unsigned int retentionTime=0, const ostring &comment=OTEXT(""))
 Alter the given queue.
 
static void Drop (const Connection &connection, const ostring &queue)
 Drop the given queue.
 
static void Start (const Connection &connection, const ostring &queue, bool enableEnqueue=true, bool enableDequeue=true)
 Start the given queue.
 
static void Stop (const Connection &connection, const ostring &queue, bool stopEnqueue=true, bool stopDequeue=true, bool wait=true)
 Stop enqueuing or dequeuing or both on the given queue.
 

Detailed Description

Class allowing the administration of Oracle Queues.

Definition at line 8284 of file types.hpp.

Member Typedef Documentation

◆ QueueType

Queue Type.

Possible values are Queue::QueueTypeValues

Definition at line 8310 of file types.hpp.

Member Enumeration Documentation

◆ QueueTypeValues

Queue Type enumerated values.

Enumerator
NormalQueue 

Normal queue

ExceptionQueue 

Exception queue

NonPersistentQueue 

Non persistent queue

Definition at line 8293 of file types.hpp.

Member Function Documentation

◆ Create()

void ocilib::Queue::Create ( const Connection connection,
const ostring queue,
const ostring table,
QueueType  type = NormalQueue,
unsigned int  maxRetries = 0,
unsigned int  retryDelay = 0,
unsigned int  retentionTime = 0,
bool  dependencyTracking = false,
const ostring comment = OTEXT("") 
)
inlinestatic

Create a queue.

Parameters
connection- Database connection
queue- Queue name
table- Queue table name
type- Queue type
maxRetries- Maximum number of attempts to dequeue a message
retryDelay- Number of seconds between attempts to dequeue a message
retentionTime- number of seconds a message is retained in the queue table after being dequeued from the queue
dependencyTracking- Parameter reserved for future use by Oracle (MUST be set to FALSE)
comment- Description of the queue
Note
Parameter 'queue' can specify the schema where to create to queue ([schema.]queue_name) Queue names cannot be longer than 24 characters (Oracle limit for user queues)
this call wraps the PL/SQL procedure DBMS_AQADM.CREATE_QUEUE(). Refer to Oracle Streams - Advanced Queuing User's Guide for more details

Definition at line 28 of file Queue.hpp.

References ocilib::core::Check(), and OCI_QueueCreate().

◆ Alter()

void ocilib::Queue::Alter ( const Connection connection,
const ostring queue,
unsigned int  maxRetries = 0,
unsigned int  retryDelay = 0,
unsigned int  retentionTime = 0,
const ostring comment = OTEXT("") 
)
inlinestatic

Alter the given queue.

Parameters
connection- Database connection
queue- Queue name
maxRetries- Maximum number of attempts to dequeue a message
retryDelay- Number of seconds between attempts to dequeue a message
retentionTime- number of seconds a message is retained in the queue table after being dequeued from the queue
comment- Description of the queue
Note
See Create() for more details
this call wraps the PL/SQL procedure DBMS_AQADM.ALTER_QUEUE(). Refer to Oracle Streams - Advanced Queuing User's Guide for more details

Definition at line 34 of file Queue.hpp.

References ocilib::core::Check(), and OCI_QueueAlter().

◆ Drop()

void ocilib::Queue::Drop ( const Connection connection,
const ostring queue 
)
inlinestatic

Drop the given queue.

Parameters
connection- Database connection
queue- Queue name
Warning
A queue can be dropped only if it has been stopped before.
Note
this call wraps the PL/SQL procedure DBMS_AQADM.DROP_QUEUE(). Refer to Oracle Streams - Advanced Queuing User's Guide for more details

Definition at line 39 of file Queue.hpp.

References ocilib::core::Check(), and OCI_QueueDrop().

◆ Start()

void ocilib::Queue::Start ( const Connection connection,
const ostring queue,
bool  enableEnqueue = true,
bool  enableDequeue = true 
)
inlinestatic

Start the given queue.

Parameters
connection- Database connection
queue- Queue name
enableEnqueue- Enable enqueue
enableDequeue- Enable dequeue
Warning
For exception queues, only enqueuing is allowed
Note
this call wraps the PL/SQL procedure DBMS_AQADM.START_QUEUE(). Refer to Oracle Streams - Advanced Queuing User's Guide for more details

Definition at line 44 of file Queue.hpp.

References ocilib::core::Check(), and OCI_QueueStart().

◆ Stop()

void ocilib::Queue::Stop ( const Connection connection,
const ostring queue,
bool  stopEnqueue = true,
bool  stopDequeue = true,
bool  wait = true 
)
inlinestatic

Stop enqueuing or dequeuing or both on the given queue.

Parameters
connection- Database connection
queue- Queue name
stopEnqueue- Disable enqueue
stopDequeue- Disable dequeue
wait- Wait for current pending enqueues/dequeues
Warning
A queue cannot be stopped if there are pending transactions against the queue.
Note
this call wraps the PL/SQL procedure DBMS_AQADM.STOP_QUEUE(). Refer to Oracle Streams - Advanced Queuing User's Guide for more details

Definition at line 49 of file Queue.hpp.

References ocilib::core::Check(), and OCI_QueueStop().