Skip to content

Commit b63b71c

Browse files
Fixed bug in the calculation of attribute
MessageProperties.deliverymode. Previously it was being set to the value of the attribute DeqOptions.deliverymode.
1 parent ab59c5f commit b63b71c

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

doc/src/release_notes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Thin Mode Changes
2121
thick mode`` is now raised when attempting to use session tagging with a
2222
connection pool. Previously a ``NotImplementedError`` exception was raised
2323
instead.
24+
#) Fixed bug in the calculation of attribute
25+
:attr:`MessageProperties.deliverymode`. Previously it was being set to the
26+
value of the attribute :attr:`DeqOptions.deliverymode`.
2427

2528
Thick Mode Changes
2629
++++++++++++++++++

src/oracledb/impl/thin/messages/aq_array.pyx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ cdef class AqArrayMessage(AqBaseMessage):
6969
props_impl.msgid = msgid[j * 16:(j + 1) * 16]
7070
else:
7171
props_impl.msgid = msgid
72-
props_impl.delivery_mode = (
73-
self.deq_options_impl.delivery_mode
74-
)
7572
buf.read_ub2(&temp16) # extensions len
7673
if temp16 > 0:
7774
errors._raise_err(errors.ERR_NOT_IMPLEMENTED)

src/oracledb/impl/thin/messages/aq_base.pyx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ cdef class AqBaseMessage(Message):
121121
errors._raise_err(errors.ERR_NOT_IMPLEMENTED)
122122
buf.skip_ub4() # csn
123123
buf.skip_ub4() # dsn
124-
buf.skip_ub4() # flags
124+
buf.read_ub4(&temp32) # flags
125+
if temp32 == TNS_KPD_AQ_BUFMSG:
126+
props_impl.delivery_mode = TNS_AQ_MSG_BUFFERED
127+
else:
128+
props_impl.delivery_mode = TNS_AQ_MSG_PERSISTENT
125129
if buf._caps.ttc_field_version >= TNS_CCAP_FIELD_VERSION_21_1:
126130
buf.skip_ub4() # shard number
127131

src/oracledb/impl/thin/queue.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ cdef class BaseThinQueueImpl(BaseQueueImpl):
7474
message = self._conn_impl._create_message(AqDeqMessage)
7575
message.queue_impl = self
7676
message.deq_options_impl = self.deq_options_impl
77-
props_impl.delivery_mode = message.deq_options_impl.delivery_mode
7877
message.props_impl = props_impl
7978
return message
8079

tests/test_2700_aq_dbobject.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def test_2710(self):
239239
queue.deqoptions.visibility = oracledb.DEQ_IMMEDIATE
240240
queue.deqoptions.wait = oracledb.DEQ_NO_WAIT
241241
props = queue.deqone()
242+
self.assertEqual(props.deliverymode, oracledb.MSG_BUFFERED)
242243
book = props.payload
243244
results = (book.TITLE, book.AUTHORS, book.PRICE)
244245
other_conn.commit()
@@ -264,6 +265,7 @@ def test_2711(self):
264265
queue.deqoptions.visibility = oracledb.DEQ_IMMEDIATE
265266
queue.deqoptions.wait = oracledb.DEQ_NO_WAIT
266267
props = queue.deqone()
268+
self.assertEqual(props.deliverymode, oracledb.MSG_PERSISTENT)
267269
book = props.payload
268270
results = (book.TITLE, book.AUTHORS, book.PRICE)
269271
other_conn.commit()
@@ -289,6 +291,7 @@ def test_2712(self):
289291
queue.deqoptions.visibility = oracledb.DEQ_IMMEDIATE
290292
queue.deqoptions.wait = oracledb.DEQ_NO_WAIT
291293
props = queue.deqone()
294+
self.assertEqual(props.deliverymode, oracledb.MSG_PERSISTENT)
292295
book = props.payload
293296
results = (book.TITLE, book.AUTHORS, book.PRICE)
294297
other_conn.commit()

tests/test_8400_aq_dbobject_async.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ async def test_8409(self):
209209
queue.deqoptions.visibility = oracledb.DEQ_IMMEDIATE
210210
queue.deqoptions.wait = oracledb.DEQ_NO_WAIT
211211
props = await queue.deqone()
212+
self.assertEqual(props.deliverymode, oracledb.MSG_BUFFERED)
212213
book = props.payload
213214
results = (book.TITLE, book.AUTHORS, book.PRICE)
214215
await other_conn.commit()
@@ -234,6 +235,7 @@ async def test_8410(self):
234235
queue.deqoptions.visibility = oracledb.DEQ_IMMEDIATE
235236
queue.deqoptions.wait = oracledb.DEQ_NO_WAIT
236237
props = await queue.deqone()
238+
self.assertEqual(props.deliverymode, oracledb.MSG_PERSISTENT)
237239
book = props.payload
238240
results = (book.TITLE, book.AUTHORS, book.PRICE)
239241
await other_conn.commit()
@@ -259,6 +261,7 @@ async def test_8411(self):
259261
queue.deqoptions.visibility = oracledb.DEQ_IMMEDIATE
260262
queue.deqoptions.wait = oracledb.DEQ_NO_WAIT
261263
props = await queue.deqone()
264+
self.assertEqual(props.deliverymode, oracledb.MSG_PERSISTENT)
262265
book = props.payload
263266
results = (book.TITLE, book.AUTHORS, book.PRICE)
264267
await other_conn.commit()

0 commit comments

Comments
 (0)