-
Notifications
You must be signed in to change notification settings - Fork 92
Closed as not planned
Closed as not planned
Copy link
Labels
questionFurther information is requestedFurther information is requested
Description
- What versions are you using?
platform.platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.36
sys.maxsize > 2**32: True
platform.python_version: 3.11.4
oracledb.__version__: 1.3.2
- Is it an error or a hang or a crash?
An error: ORA-24911: Cannot start listener thread at specified port
- What error(s) or behavior you are seeing?
When using CQN (Continous Query Notification) in connection pooling mode and setting a port in connection.subscribe()
, i'm getting this traceback:
Traceback (most recent call last):
File "/app/wbe_tms_api/wbe_tms_api.py", line 52, in <module>
subscr = connection.subscribe(callback=cqn_callback,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/oracledb/connection.py", line 801, in subscribe
impl.subscribe(subscr, self._impl)
File "src/oracledb/impl/thick/subscr.pyx", line 171, in oracledb.thick_impl.ThickSubscrImpl.subscribe
File "src/oracledb/impl/thick/utils.pyx", line 413, in oracledb.thick_impl._raise_from_odpi
File "src/oracledb/impl/thick/utils.pyx", line 403, in oracledb.thick_impl._raise_from_info
oracledb.exceptions.DatabaseError: ORA-24911: Cannot start listener thread at specified port
- Does your application call init_oracle_client()?
Yes, using thick mode
- Include a runnable Python script that shows the problem.
import oracledb
def cqn_callback(message):
logging.info("Notification:")
for query in message.queries:
for tab in query.tables:
logging.info("Table:", tab.name)
logging.info("Operation:", tab.operation)
oracledb.init_oracle_client()
dbpool = oracledb.create_pool(user="user", password="password", dsn="dsn", min=1, max=1, increment=0, expire_time=1, events=True)
with dbpool.acquire() as connection:
subscr = connection.subscribe(callback=cqn_callback,
operations=oracledb.OPCODE_ALLOPS,
qos=oracledb.SUBSCR_QOS_BEST_EFFORT | oracledb.SUBSCR_QOS_ROWIDS,
port=8134)
subscr.registerquery(
"""
SELECT deviceid, regnskab, afd, afsender, app_modul, dialog_id, ekstern_ref, emne, art, tekst, type, udfoert, status
FROM TMS.WBE_TMS_BESKED
""")
logging.info("Registered query")
time.sleep(10000000)
The following snippet using a simple connection instead is working as expected:
def cqn_callback(message):
logging.info("Notification:")
for query in message.queries:
for tab in query.tables:
logging.info("Table:", tab.name)
logging.info("Operation:", tab.operation)
oracledb.init_oracle_client()
connection = oracledb.connect(user="user", password="password", dsn="dsn", events=True)
# dbpool = oracledb.create_pool(user="user", password="password", dsn="dsn", min=1, max=1, increment=0, expire_time=1, events=True)
# with dbpool.acquire() as connection:
subscr = connection.subscribe(callback=cqn_callback,
operations=oracledb.OPCODE_ALLOPS,
qos=oracledb.SUBSCR_QOS_BEST_EFFORT | oracledb.SUBSCR_QOS_ROWIDS,
port=8134)
subscr.registerquery(
"""
SELECT deviceid, regnskab, afd, afsender, app_modul, dialog_id, ekstern_ref, emne, art, tekst, type, udfoert, status
FROM TMS.WBE_TMS_BESKED
""")
logging.info("Registered query")
time.sleep(10000000)
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested