OCILIB (C and C++ Driver for Oracle)  4.1.0
ocilib::Queue Class Reference

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

#include <ocilib.hpp>

Public Types

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

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. More...
 
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. More...
 
static void Drop (const Connection &connection, const ostring &queue)
 Drop the given queue. More...
 
static void Start (const Connection &connection, const ostring &queue, bool enableEnqueue=true, bool enableDequeue=true)
 Start the given queue. More...
 
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. More...
 

Detailed Description

Class allowing the administration of Oracle Queues.

Definition at line 7887 of file ocilib.hpp.

Member Typedef Documentation

Queue Type.

Possible values are Queue::QueueTypeValues

Definition at line 7913 of file ocilib.hpp.

Member Enumeration Documentation

Queue Type enumerated values.

Enumerator
NormalQueue 

Normal queue

ExceptionQueue 

Exception queue

NonPersistentQueue 

Non persistent queue

Definition at line 7896 of file ocilib.hpp.

Member Function Documentation

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 6502 of file ocilib_impl.hpp.

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

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 6508 of file ocilib_impl.hpp.

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

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 6513 of file ocilib_impl.hpp.

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

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 6518 of file ocilib_impl.hpp.

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

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 6523 of file ocilib_impl.hpp.

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