2. Connection Objects

NOTE: Any outstanding changes will be rolled back when the connection object is destroyed or closed.

action
This write-only attribute sets the action column in the v$session table and is only available in Oracle 10g.

NOTE: This attribute is an extension to the DB API definition.

begin( )
begin( [formatId, transactionId, branchId])
Explicitly begin a new transaction. Without parameters, this explicitly begins a local transaction; otherwise, this explicitly begins a distributed (global) transaction with the given parameters. See the Oracle documentation for more details.

Note that in order to make use of global (distributed) transactions, the twophase argument to the Connection constructor must be a true value. See the comments on the Connection constructor for more information (1).

NOTE: This method is an extension to the DB API definition.

cancel( )
Cancel a long-running transaction. This is only effective on non-Windows platforms.

clientinfo
This write-only attribute sets the client_info column in the v$session table and is only available in Oracle 10g.

NOTE: This attribute is an extension to the DB API definition.

close( )
Close the connection now, rather than whenever __del__ is called. The connection will be unusable from this point forward; an Error exception will be raised if any operation is attempted with the connection. The same applies to any cursor objects trying to use the connection.

commit( )
Commit any pending transactions to the database.

cursor( )
Return a new Cursor object (3) using the connection.

dsn
This read-only attribute returns the TNS entry of the database to which a connection has been established.

NOTE: This attribute is an extension to the DB API definition.

encoding
This read-only attribute returns the IANA character set name of the character set in use by the Oracle client.

NOTE: This attribute is an extension to the DB API definition.

maxBytesPerCharacter
This read-only attribute returns the maximum number of bytes each character can use for the client character set.

NOTE: This attribute is an extension to the DB API definition.

module
This write-only attribute sets the module column in the v$session table and is only available in Oracle 10g.

NOTE: This attribute is an extension to the DB API definition.

nencoding
This read-only attribute returns the IANA character set name of the national character set in use by the Oracle client.

NOTE: This attribute is an extension to the DB API definition.

password
This read-only attribute returns the password of the user which established the connection to the database.

NOTE: This attribute is an extension to the DB API definition.

prepare( )
Prepare the distributed (global) transaction for commit.

NOTE: This method is an extension to the DB API definition.

register( code, when, function)
Register the function as an OCI callback. The code is one of the function codes defined in the Oracle documentation of which the most common ones are defined as constants in this module. The when parameter is one of UCBTYPE_ENTRY, UCBTYPE_EXIT or UCBTYPE_REPLACE. The function is a Python function which will accept the parameters that the OCI function accepts, modified as needed to return Python objects that are of some use. Note that this is a highly experimental method and can cause cx_Oracle to crash if not used properly. In particular, the OCI does not provide sizing information to the callback so attempts to access a variable beyond the allocated size will crash cx_Oracle. Use with caution.

NOTE: This method is an extension to the DB API definition.

rollback( )
Rollback any pending transactions.

tnsentry
This read-only attribute returns the TNS entry of the database to which a connection has been established.

NOTE: This attribute is an extension to the DB API definition.

unregister( code, when)
Unregister the function as an OCI callback. The code is one of the function codes defined in the Oracle documentation of which the most common ones are defined as constants in this module. The when parameter is one of UCBTYPE_ENTRY, UCBTYPE_EXIT or UCBTYPE_REPLACE.

NOTE: This method is an extension to the DB API definition.

username
This read-only attribute returns the name of the user which established the connection to the database.

NOTE: This attribute is an extension to the DB API definition.

version
This read-only attribute returns the version of the database to which a connection has been established.

NOTE: This attribute is an extension to the DB API definition.