@@ -400,6 +400,7 @@ cdef class ThickMsgPropsImpl(BaseMsgPropsImpl):
400400 cdef:
401401 dpiMsgProps* _handle
402402 ThickConnImpl _conn_impl
403+ bint _has_been_dequeued
403404
404405 def __dealloc__ (self ):
405406 if self ._handle != NULL :
@@ -414,6 +415,7 @@ cdef class ThickMsgPropsImpl(BaseMsgPropsImpl):
414415 dpiJsonNode * node
415416 dpiJson * json
416417
418+ self ._has_been_dequeued = True
417419 self ._conn_impl = queue_impl._conn_impl
418420 if queue_impl.is_json:
419421 if dpiMsgProps_getPayloadJson(self ._handle, & json) < 0 :
@@ -480,12 +482,13 @@ cdef class ThickMsgPropsImpl(BaseMsgPropsImpl):
480482 Internal method for getting the enqueue time.
481483 """
482484 cdef dpiTimestamp timestamp
483- if dpiMsgProps_getEnqTime(self ._handle, & timestamp) < 0 :
484- _raise_from_odpi()
485- return cydatetime.datetime_new(timestamp.year, timestamp.month,
486- timestamp.day, timestamp.hour,
487- timestamp.minute, timestamp.second,
488- timestamp.fsecond // 1000 , None )
485+ if self ._has_been_dequeued:
486+ if dpiMsgProps_getEnqTime(self ._handle, & timestamp) < 0 :
487+ _raise_from_odpi()
488+ return cydatetime.datetime_new(timestamp.year, timestamp.month,
489+ timestamp.day, timestamp.hour,
490+ timestamp.minute, timestamp.second,
491+ timestamp.fsecond // 1000 , None )
489492
490493 def get_exception_queue (self ):
491494 """
0 commit comments