@@ -480,11 +480,18 @@ Connection Object
480480 This attribute is an extension to the DB API definition.
481481
482482
483- .. method :: Connection.subscribe(namespace=cx_Oracle.SUBSCR_NAMESPACE_DBCHANGE, protocol=cx_Oracle.SUBSCR_PROTO_OCI, callback=None, timeout=0, operations=OPCODE_ALLOPS, port=0, qos=0, ipAddress=None, groupingClass=0, groupingValue=0, groupingType=cx_Oracle.SUBSCR_GROUPING_TYPE_SUMMARY)
483+ .. method :: Connection.subscribe(namespace=cx_Oracle.SUBSCR_NAMESPACE_DBCHANGE, protocol=cx_Oracle.SUBSCR_PROTO_OCI, callback=None, timeout=0, operations=OPCODE_ALLOPS, port=0, qos=0, ipAddress=None, groupingClass=0, groupingValue=0, groupingType=cx_Oracle.SUBSCR_GROUPING_TYPE_SUMMARY, name=None )
484484
485- Return a new :ref: `subscription object <subscrobj >` using the connection.
486- Currently the namespace and protocol parameters cannot have any other
487- meaningful values.
485+ Return a new :ref: `subscription object <subscrobj >` that receives
486+ notifications for events that take place in the database that match the
487+ given parameters.
488+
489+ The namespace parameter specifies the namespace the subscription uses. It
490+ can be one of :data: `cx_Oracle.SUBSCR_NAMESPACE_DBCHANGE ` or
491+ :data: `cx_Oracle.SUBSCR_NAMESPACE_AQ `.
492+
493+ The protocol parameter specifies the protocol to use when notifications are
494+ sent. Currently the only valid value is :data: `cx_Oracle.SUBSCR_PROTO_OCI `.
488495
489496 The callback is expected to be a callable that accepts a single parameter.
490497 A :ref: `message object <msgobjects >` is passed to this callback whenever a
@@ -496,11 +503,12 @@ Connection Object
496503
497504 The operations parameter enables filtering of the messages that are sent
498505 (insert, update, delete). The default value will send notifications for all
499- operations.
506+ operations. This parameter is only used when the namespace is set to
507+ :data: `cx_Oracle.SUBSCR_NAMESPACE_DBCHANGE `.
500508
501509 The port parameter specifies the listening port for callback notifications
502510 from the database server. If not specified, an unused port will be selected
503- by the database .
511+ by the Oracle Client libraries .
504512
505513 The qos parameter specifies quality of service options. It should be one or
506514 more of the following flags, OR'ed together:
@@ -510,9 +518,10 @@ Connection Object
510518 :data: `cx_Oracle.SUBSCR_QOS_QUERY `,
511519 :data: `cx_Oracle.SUBSCR_QOS_BEST_EFFORT `.
512520
513- The ipAddress parameter specifies the IP address (IPv4 or IPv6) to bind for
514- callback notifications from the database server. If not specified, the
515- client IP address will be determined by the Oracle Client libraries.
521+ The ipAddress parameter specifies the IP address (IPv4 or IPv6) in standard
522+ string notation to bind for callback notifications from the database
523+ server. If not specified, the client IP address will be determined by the
524+ Oracle Client libraries.
516525
517526 The groupingClass parameter specifies what type of grouping of
518527 notifications should take place. Currently, if set, this value can only be
@@ -522,18 +531,30 @@ Connection Object
522531 values :data: `cx_Oracle.SUBSCR_GROUPING_TYPE_SUMMARY ` (the default) or
523532 :data: `cx_Oracle.SUBSCR_GROUPING_TYPE_LAST `.
524533
534+ The name parameter is used to identify the subscription and is specific to
535+ the selected namespace. If the namespace parameter is
536+ :data: `cx_Oracle.SUBSCR_NAMESPACE_DBCHANGE ` then the name is optional and
537+ can be any value. If the namespace parameter is
538+ :data: `cx_Oracle.SUBSCR_NAMESPACE_AQ `, however, the name must be in the
539+ format '<QUEUE_NAME>' for single consumer queues and
540+ '<QUEUE_NAME>:<CONSUMER_NAME>' for multiple consumer queues, and identifies
541+ the queue that will be monitored for messages. The queue name may include
542+ the schema, if needed.
543+
525544 *New in version 6.4: * The parameters ipAddress, groupingClass,
526- groupingValue and groupingType were added.
545+ groupingValue, groupingType and name were added.
527546
528547 .. note ::
529548
530549 This method is an extension to the DB API definition.
531550
532551 .. note ::
533552
534- Do not close the connection before the subscription object is deleted
535- or the subscription object will not be deregistered in the database.
536- This is done automatically if connection.close() is never called.
553+ The subscription can be deregistered in the database by calling the
554+ function :meth: `~Connection.unsubscribe() `. If this method is not
555+ called and the connection that was used to create the subscription is
556+ explictly closed using the function :meth: `~Connection.close() `, the
557+ subscription will not be deregistered in the database.
537558
538559
539560.. attribute :: Connection.tnsentry
@@ -546,6 +567,16 @@ Connection Object
546567 This attribute is an extension to the DB API definition.
547568
548569
570+ .. method :: Connection.unsubscribe(subscr)
571+
572+ Unsubscribe from events in the database that were originally subscribed to
573+ using :meth: `~Connection.subscribe() `. The connection used to unsubscribe
574+ should be the same one used to create the subscription, or should access
575+ the same database and be connected as the same user name.
576+
577+ .. versionadded :: 6.4
578+
579+
549580.. attribute :: Connection.username
550581
551582 This read-only attribute returns the name of the user which established the
0 commit comments