Inherits From:
EOAdaptorChannel : NSObject
Declared in:
OracleEOAdaptor/OracleChannel.h
OracleEOAdaptor/OracleDescription.h
Class Description
An OracleChannel represents an independent communication channel to the database server its OracleAdaptor is connected to. All of an OracleChannel's operations take place within the context of transactions controlled or tracked by its OracleContext. An OracleContext can manage multiple OracleChannels, and a channel is associated with only one context.
The features OracleChannel adds to EOAdaptorChannel are as follows:
Returns the SQL statement that will be executed when building a default model.
setOracleTableNamesSQL:
+ (void)setOracleTableNamesSQL: (NSString *)sql
Sets to sql the SQL statement that will be used to return a list of table names from the database. By default, this list is the result of the SQL statement:
SELECT TABLE_NAME FROM USER_TABLES ORDER BY TABLE_NAME
This setting is used by all OracleChannels in an application. You can specify a different SQL statement using the defaults write command, for example:
% defaults write NSGlobalDomain OracleTableNamesSQL "SELECT TABLE_NAME FROM..."
Once you use setOracleTableNamesSQL:
to specify a setting, it supersedes values set with the defaults write command.
Instance Methods
cursorDataArea
- (struct cda_def *)cursorDataArea
If the channel is connected, returns an Oracle-specific data structure (cda_def ) describing characteristics of the channel. Otherwise, returns NULL. This method is commonly used with the method raiseOracleError
to determine why an error occurred.
describeModelWithTableNames:
- (EOModel *)describeModelWithTableNames: (NSArray *)tableNames
Overrides the EOAdaptorChannel method describeModelWithTableNames:
to create and return a default model containing entities for the tables specified in tableNames. Assigns the adaptor name and connection dictionary to the new model. This method is typically used in conjunction with describeTableNames
. Raises an exception if an error occurs.
See also:
- describeTableNames
describeTableNames
- (NSArray *)describeTableNames
Overrides the EOAdaptorChannel method describeTableNames
to return an array of the names of all the tables owned by the current user. Uses the SQL defined in EOOracleTableNamesSQL if it exists.
This method is used in conjunction with describeModelWithTableNames:
to build a default model.
See also:
- describeModelWithTableNames:
fetchBufferLength
- (unsigned)fetchBufferLength
Returns the size, in bytes, of the fetch buffer. The larger the buffer, the more rows can be returned for each round trip to the server.
See also:
- setFetchBufferLength:
raiseOracleError
- (void)raiseOracleError
Examines Oracle structures for error flags and raises an exception if one is found. Takes an error code and converts it into an error message. This method is invoked whenever the channel encounters an error reported by the Oracle server. This uses cursorDataArea
, hostDataArea
, and logonDataArea
to retrieve Oracle-specific data structures from the channel and context to determine what error has occurred. (The hostDataArea
and logonDataArea
methods are declared in the OracleContext class.)
setFetchBufferLength:
- (void)setFetchBufferLength: (unsigned)length
Sets to length the size, in bytes, of the fetch buffer. The larger the buffer, the more rows can be returned for each round trip to the server.
See also:
- fetchBufferLength