Skip to content

Commit 5f8d24d

Browse files
Eliminated deprecation of attribute "id" on subscriptions. It is now populated
with the value of REGID found in the database view USER_CHANGE_NOTIFICATION_REGS or the value of REG_ID found in the database view USER_SUBSCR_REGISTRATIONS. For AQ subscriptions, the value is 0.
1 parent 1d0dd29 commit 5f8d24d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

doc/src/subscription.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ Subscription Object
2323

2424
.. attribute:: Subscription.id
2525

26-
This read-only attribute returns the value 0.
27-
28-
.. deprecated:: 6.0
29-
This attribute was never intended to be exposed and will be removed
30-
in cx_Oracle 7.
26+
This read-only attribute returns the value of ``REGID`` found in the
27+
database view ``USER_CHANGE_NOTIFICATION_REGS`` or the value of ``REG_ID``
28+
found in the database view ``USER_SUBSCR_REGISTRATIONS``. For AQ
29+
subscriptions, the value is 0.
3130

3231

3332
.. attribute:: Subscription.ipAddress

samples/DatabaseChangeNotification.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def callback(message):
5252
qos = cx_Oracle.SUBSCR_QOS_ROWIDS)
5353
print("Subscription:", sub)
5454
print("--> Connection:", sub.connection)
55+
print("--> ID:", sub.id)
5556
print("--> Callback:", sub.callback)
5657
print("--> Namespace:", sub.namespace)
5758
print("--> Protocol:", sub.protocol)

src/cxoConnection.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,7 @@ static PyObject *cxoConnection_subscribe(cxoConnection *conn, PyObject* args,
17861786
Py_DECREF(subscr);
17871787
return NULL;
17881788
}
1789+
subscr->id = params.outRegId;
17891790
cxoBuffer_clear(&ipAddressBuffer);
17901791
cxoBuffer_clear(&nameBuffer);
17911792

0 commit comments

Comments
 (0)