Opened 4 years ago
Closed 3 years ago
#32701 closed New feature (wontfix)
Oracle AWD/ATP Wallet Use additional configurations needed for Mac environment
Reported by: | Jordi | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 3.2 |
Severity: | Normal | Keywords: | oracle |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When using cx_Oracle to connect to an Oracle AWD or ATP, the user may need to use a wallet.
Per cx-oracle documentation, https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html#id6, we might need to use init_oracle_client function to pass lib_dir and config_dir paths.
import cx_Oracle cx_Oracle.init_oracle_client(lib_dir="/Users/your_username/Downloads/instantclient_19_8", config_dir="/Users/your_username/oracle/your_config_dir")
If I add the Database.init_oracle_client /django/db/backends/oracle/base.py, it works without issue.
try: import cx_Oracle as Database Database.init_oracle_client(lib_dir="/Users/user/Oracle/instantclient_19_8", config_dir="/Users/user/Oracle/Wallet_DB") except ImportError as e: raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e)
Removing the init_oracle_client, I get a segmentation fault:
Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). Fatal Python error: Segmentation fault Current thread 0x0000700002442000 (most recent call first):
Would it be possible to add configuration variables in settings.py for lib_dir and config_dir?
Or, would it be better to assign lib_dir value from an environmental variable ORACLE_HOME and config_dir from TNS_ADMIN?
Change History (3)
comment:1 by , 4 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 3 years ago
Resolution: | wontfix |
---|---|
Status: | closed → new |
The workarounds, particularly on macOS are not the nicest. Development and app portability are a lot easier if init_oracle_client() is called.
comment:3 by , 3 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I appreciate you'd like to reopen the ticket, but please follow the triaging guidelines with regards to wontfix tickets and take this to DevelopersMailingList.
I don't think that additional configuration in needed.
cx_Oracle
has documented fallbacks iflib_dir
is not specified, see Locating the Oracle Client Libraries. You can link them in thecx_Oracle
installation directory or install aninstantclient
on the system library search path. Personally, I prefer usingldconfig
, e.g.