Skip to content

Commit b30e66f

Browse files
Preparing to release cx_Oracle 6.0.
1 parent f1f5ead commit b30e66f

File tree

5 files changed

+113
-68
lines changed

5 files changed

+113
-68
lines changed

README.md

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,41 @@ cx_Oracle is a Python extension module that enables access to Oracle Database.
44
It conforms to the [Python database API 2.0 specification][1] with a
55
considerable number of additions and a couple of exclusions.
66

7-
cx_Oracle is licensed under a [BSD license] which you can find [here][3].
7+
cx_Oracle is licensed under a BSD license which you can find [here][3].
88

9-
cx_Oracle 6 has been tested with Python version 2.7, and with versions 3.4 and
10-
higher. You can use cx_Oracle with Oracle 11.2, 12.1 and 12.2 client libraries,
11-
allowing connection to multiple Oracle Database versions. Oracle's standard
12-
client-server version interoperability allows connection to both older and
13-
newer databases, for example Oracle 12.2 client libraries can connect to Oracle
9+
cx_Oracle 6 has been tested with Python version 2.7, and with versions
10+
3.4 and higher. You can use cx_Oracle with Oracle 11.2, 12.1 and 12.2
11+
client libraries. Oracle's standard client-server version
12+
interoperability allows connection to both older and newer databases,
13+
for example Oracle 12.2 client libraries can connect to Oracle
1414
Database 11.2 or later.
1515

16+
## Documentation
17+
18+
See the [cx_Oracle Documentation][2] and [Release Notes][14].
19+
1620
## Help
1721

1822
Issues and questions can be raised with the cx_Oracle community on
1923
[GitHub][9] or on the [mailing list][5].
2024

21-
## Documentation
22-
23-
See the [cx_Oracle Documentation][2] and [Release Notes][14].
24-
2525
## Installation
2626

2727
See [cx_Oracle Installation][15] for detailed instructions.
2828

29-
- The simplest way to install cx_Oracle 6 RC2 is with pip:
29+
- The simplest way to install cx_Oracle 6 is with pip:
3030

31-
`python -m pip install cx_Oracle --pre`
31+
```
32+
python -m pip install cx_Oracle --upgrade
33+
```
3234

3335
If a binary wheel package is not available on [PyPI][6] for your platform, the
3436
source package will be used.
3537

38+
Note that if you download a source zip file directly from GitHub
39+
that you will also need to download an [ODPI-C][10] source zip file
40+
and extract it inside the directory called "odpi".
41+
3642
- After cx_Oracle is installed, Oracle client libraries must also be installed
3743
and configured. These can be from Oracle Instant Client, from a local Oracle
3844
Database, or from a full Oracle Client installation.
@@ -42,44 +48,40 @@ See [cx_Oracle Installation][15] for detailed instructions.
4248
platform-specific library path loading environment. See
4349
the [installation notes for ODPI-C][13] for help.
4450

45-
Versions 11.2, 12.1 and 12.2 of the Oracle Client libraries on Linux,
46-
Windows and macOS are supported. Users have also reported success
47-
with other platforms.
48-
49-
Note that if you download a source zip file directly from GitHub that
50-
you will also need to download an [ODPI-C][10] source zip file and
51-
extract it inside the directory called "odpi".
51+
Versions 11.2, 12.1 and 12.2 of the Oracle Client libraries on Linux,
52+
Windows and macOS are supported. Users have also reported success
53+
with other platforms.
5254

55+
If you require cx_Oracle 5.3, download a Windows installer from
56+
[PyPI][16] or use `python -m pip install cx-oracle==5.3` to
57+
install from source.
5358

54-
## Usage Example
59+
Very old versions of cx_Oracle can be found in the files section at
60+
[SourceForce][17].
5561

62+
## Example
5663

5764
```python
58-
from __future__ import print_function # needed for Python 2.x
65+
from __future__ import print_function
5966

6067
import cx_Oracle
6168

62-
# connect via SQL*Net string or by each segment in a separate argument
63-
#connection = cx_Oracle.connect("user/password@TNS")
64-
connection = cx_Oracle.connect("user", "password", "TNS")
69+
connection = cx_Oracle.connect("hr", "welcome", "localhost/orclpdb")
6570

6671
cursor = connection.cursor()
6772
cursor.execute("""
68-
select Col1, Col2, Col3
69-
from SomeTable
70-
where Col4 = :arg_1
71-
and Col5 between :arg_2 and :arg_3""",
72-
arg_1 = "VALUE",
73-
arg_2 = 5,
74-
arg_3 = 15)
75-
for column_1, column_2, column_3 in cursor:
76-
print("Values:", column_1, column_2, column_3)
73+
SELECT first_name, last_name
74+
FROM employees
75+
WHERE department_id = :did AND employee_id > :eid""",
76+
did = 50,
77+
eid = 190)
78+
for fname, lname in cursor:
79+
print("Values:", fname, lname)
7780
```
7881

79-
8082
For more examples, please see the [test suite][11] and the
81-
[samples][12]. You can also look at the scripts in the [cx_OracleTools][7] and
82-
the modules in the [cx_PyOracleLib][8] projects.
83+
[samples][12]. You can also look at the scripts in [cx_OracleTools][7] and
84+
the modules in [cx_PyOracleLib][8].
8385

8486
## Features
8587

@@ -94,15 +96,10 @@ the modules in the [cx_PyOracleLib][8] projects.
9496
- Connect to Oracle Database 9.2, 10, 11 or 12 (depending on the
9597
Oracle Client version used).
9698

97-
- SQL and PL/SQL Execution, with full support for OCI features like
98-
statement caching and statement caching auto-tuning. Oracle OCI
99-
(which is the database access layer used by cx_Oracle) has
100-
significant optimizations, including compressed fetch, pre-fetching,
101-
client and server result set caching, and statement caching.
102-
cx_Oracle applications can additionally make full use of PL/SQL to
103-
keep business logic near the data in the database, where it can be
104-
processed without having to ship large volumes of data to the
105-
application.
99+
- SQL and PL/SQL Execution. The underlying Oracle Client libraries
100+
have significant optimizations including compressed fetch,
101+
pre-fetching, client and server result set caching, and statement
102+
caching with auto-tuning.
106103

107104
- Full use of Oracle Network Service infrastructure, including
108105
encrypted network traffic and security features.
@@ -182,3 +179,5 @@ for more information.
182179
[13]: https://oracle.github.io/odpi/doc/installation.html
183180
[14]: http://cx-oracle.readthedocs.io/en/latest/releasenotes.html
184181
[15]: http://cx-oracle.readthedocs.io/en/latest/installation.html
182+
[16]: https://pypi.python.org/pypi/cx_Oracle/5.3
183+
[17]: https://sourceforge.net/projects/cx-oracle/files/

doc/src/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# The short X.Y version.
4343
version = '6.0'
4444
# The full version, including alpha/beta/rc tags.
45-
release = '6.0rc2'
45+
release = '6.0'
4646

4747
# There are two options for replacing |today|: either, you set today to some
4848
# non-false value, then it is used:

doc/src/installation.rst

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,33 @@ Before cx_Oracle can be installed, an installation of
1111
`Python <https://www.python.org/downloads>`__ is needed first. Python 2.7 and
1212
Python 3.4 and higher are supported.
1313

14-
The simplest method of installation is to `Install Using Pip`_. You can also
15-
`Install Using GitHub`_. If you run into trouble, check out the section on
16-
`Troubleshooting`_.
14+
The simplest method of installing cx_Oracle is to `Install Using Pip`_. You
15+
can also `Install Using GitHub`_. If you run into trouble, check out the
16+
section on `Troubleshooting`_. cx_Oracle uses `ODPI-C
17+
<https://github.com/oracle/odpi>`__, which means that the `ODPI-C installation
18+
instructions <https://oracle.github.io/odpi/doc/installation.html>`__ can be
19+
useful to review.
1720

1821
After cx_Oracle has been installed, you must also `Install Oracle Client`_, if
1922
that has not been done already. Oracle Client versions 12.2, 12.1 and 11.2
2023
are supported.
2124

22-
Note installation has changed from cx_Oracle 5. When using Oracle
23-
Instant Client, you should not set ``ORACLE_HOME``.
25+
Finally, you need an `Oracle Database`_ for Python to connect to. Oracle's
26+
standard client-server version interoperability allows cx_Oracle to connect to
27+
both older and newer databases. Python can be local or remote to the database.
28+
29+
30+
Upgrading from cx_Oracle 5
31+
==========================
32+
33+
If you are upgrading from cx_Oracle 5 note these installation changes:
34+
35+
- When using Oracle Instant Client, you should not set ``ORACLE_HOME``.
36+
37+
- On Linux, cx_Oracle 6 no longer uses Instant Client RPMs automatically.
38+
You must set ``LD_LIBRARY_PATH`` or use ``ldconfig`` to locate the Oracle
39+
client library.
40+
2441

2542
Install Using Pip
2643
=================
@@ -29,17 +46,17 @@ Pip is the generic tool for installing Python packages. If you do not have pip,
2946
see the `pip installation documentation
3047
<http://pip.readthedocs.io/en/latest/installing/>`__.
3148

32-
The command to install the current Release Candidate of cx_Oracle 6 using pip
33-
on all platforms is::
49+
The command to install cx_Oracle 6 using pip on all platforms is::
3450

35-
python -m pip install cx_Oracle --upgrade --pre
51+
python -m pip install cx_Oracle --upgrade
3652

3753
This will download and install a pre-compiled binary matching your platform
3854
and architecture automatically, if one is available. Pre-compiled binaries are
39-
available for Windows and Linux.
55+
available for Windows and Linux. See
56+
`PyPI <https://pypi.python.org/pypi/cx_Oracle>`__.
4057

4158
If a pre-compiled binary is not available, the source will be
42-
downloaded, compiled, and the resulting binary installed. On Linux if
59+
downloaded, compiled, and the resulting binary installed. On Linux if
4360
cx_Oracle needs to be compiled for the default python package, you
4461
will need the ``python-devel`` package or equivalent, which provides
4562
the `Python.h` header file.
@@ -106,13 +123,13 @@ Oracle Client libraries allow connection to older and newer databases.
106123
In summary, Oracle Client 12.2 can connect to Oracle Database 11.2 or
107124
greater. Oracle Client 12.1 can connect to Oracle Database 10.2 or
108125
greater. Oracle Client 11.2 can connect to Oracle Database 9.2 or
109-
greater. For additional information on which Oracle Database releases
126+
greater. For additional information on which Oracle Database releases
110127
are supported by which Oracle client versions, please see `Doc ID 207303.1
111128
<https://support.oracle.com/epmos/faces/DocumentDisplay?id=207303.1>`__.
112129

113130
Since a single cx_Oracle binary can use multiple client versions and access
114131
multiple database versions, it is important your application is tested in your
115-
intended release environments. Newer Oracle clients support new features, such
132+
intended release environments. Newer Oracle clients support new features, such
116133
as the `oraaccess.xml <https://docs.oracle.com/database/122/LNOCI/
117134
more-oci-advanced-topics.htm#LNOCI73052>`__ external configuration file
118135
available with 12.1 or later clients, and `session pool enhancements
@@ -138,15 +155,6 @@ errors. These include:
138155
- when attempting to get array DML row counts with Oracle Client
139156
11.2 you will get the error "DPI-1013: not supported"
140157

141-
cx_Oracle is an `ODPI-C <https://github.com/oracle/odpi>`__ application, which
142-
means that the installation instructions for
143-
`Linux <https://oracle.github.io/odpi/doc/installation.html#linux>`__,
144-
`Windows <https://oracle.github.io/odpi/doc/installation.html#windows>`__
145-
and `macOS <https://oracle.github.io/odpi/doc/installation.html#macos>`__
146-
are applicable. For other platforms like Solaris or AIX, follow the same
147-
general directions as for Linux.
148-
149-
150158
Troubleshooting
151159
===============
152160

doc/src/releasenotes.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,44 @@ cx_Oracle Release Notes
44
6.x releases
55
############
66

7+
Version 6.0 (August 2017)
8+
-------------------------
9+
10+
#) Update to `ODPI-C 2.0 <https://oracle.github.io/odpi/doc/releasenotes.html
11+
#version-2-0-august-14-2017>`__.
12+
13+
- Prevent closing the connection when there are any open statements or
14+
LOBs and add new error "DPI-1054: connection cannot be closed when open
15+
statements or LOBs exist" when this situation is detected; this is
16+
needed to prevent crashes under certain conditions when statements or
17+
LOBs are being acted upon while at the same time (in another thread) a
18+
connection is being closed; it also prevents leaks of statements and
19+
LOBs when a connection is returned to a session pool.
20+
- On platforms other than Windows, if the regular method for loading the
21+
Oracle Client libraries fails, try using $ORACLE_HOME/lib/libclntsh.so
22+
(`ODPI-C issue 20 <https://github.com/oracle/odpi/issues/20>`__).
23+
- Use the environment variable DPI_DEBUG_LEVEL at runtime, not compile
24+
time.
25+
- Added support for DPI_DEBUG_LEVEL_ERRORS (reports errors and has the
26+
value 8) and DPI_DEBUG_LEVEL_SQL (reports prepared SQL statement text
27+
and has the value 16) in order to further improve the ability to debug
28+
issues.
29+
- Correct processing of :meth:`Cursor.scroll()` in some circumstances.
30+
31+
#) Delay initialization of the ODPI-C library until the first standalone
32+
connection or session pool is created so that manipulation of the
33+
environment variable NLS_LANG can be performed after the module has been
34+
imported; this also has the added benefit of reducing the number of errors
35+
that can take place when the module is imported.
36+
#) Prevent binding of null values from generating the exception "ORA-24816:
37+
Expanded non LONG bind data supplied after actual LONG or LOB column" in
38+
certain circumstances
39+
(`issue 50 <https://github.com/oracle/python-cx_Oracle/issues/50>`__).
40+
#) Added information on how to run the test suite
41+
(`issue 33 <https://github.com/oracle/python-cx_Oracle/issues/33>`__).
42+
#) Documentation improvements.
43+
44+
745
Version 6.0 rc 2 (July 2017)
846
----------------------------
947

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from distutils.extension import Extension
2121

2222
# define build constants
23-
BUILD_VERSION = "6.0rc2"
23+
BUILD_VERSION = "6.0"
2424

2525
# define the list of files to be included as documentation for Windows
2626
dataFiles = None

0 commit comments

Comments
 (0)