Skip to content

Commit 916ca5d

Browse files
Improve thin mode error message for connection pool tagging.
1 parent afa5ba6 commit 916ca5d

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

doc/src/release_notes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ oracledb `3.3.0 <https://github.com/oracle/python-oracledb/compare/v3.2.0...v3.3
1717
Thin Mode Changes
1818
+++++++++++++++++
1919

20+
#) Error ``DPY-3001: session tagging is only supported in python-oracledb
21+
thick mode`` is now raised when attempting to use session tagging with a
22+
connection pool. Previously a ``NotImplementedError`` exception was raised
23+
instead.
24+
2025
Thick Mode Changes
2126
++++++++++++++++++
2227

src/oracledb/impl/thin/pool.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ cdef class ThinPoolImpl(BaseThinPoolImpl):
622622

623623
# session tagging has not been implemented yet
624624
if params.tag is not None:
625-
raise NotImplementedError("Tagging has not been implemented yet")
625+
errors._raise_not_supported("session tagging")
626626

627627
# wait until an acceptable connection is found
628628
request = self._create_request(params)
@@ -812,7 +812,7 @@ cdef class AsyncThinPoolImpl(BaseThinPoolImpl):
812812

813813
# session tagging has not been implemented yet
814814
if params.tag is not None:
815-
raise NotImplementedError("Tagging has not been implemented yet")
815+
errors._raise_not_supported("session tagging")
816816

817817
# use the helper function to allow for a timeout since asyncio
818818
# condition variables do not have that capability directly

tests/test_7300_unsupported_features_thin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ def test_7303(self):
6262
password=test_env.get_main_password(),
6363
)
6464

65+
def test_7304(self):
66+
"7304 - test acquire() from a pool with a session tag"
67+
pool = test_env.get_pool()
68+
with self.assertRaisesFullCode("DPY-3001"):
69+
pool.acquire(tag="unimportant")
70+
6571

6672
if __name__ == "__main__":
6773
test_env.run_test_cases()

0 commit comments

Comments
 (0)