InformixChannel

Inherits From:
EOAdaptorChannel : NSObject

Declared in: InformixEOAdaptor/InformixChannel.h
InformixEOAdaptor/InformixDescription.h

Class Description

An InformixChannel represents an independent communication channel to the database server its InformixAdaptor is connected to. All of an InformixChannel's operations take place within the context of transactions controlled or tracked by its InformixContext. An InformixContext can manage multiple InformixChannels, and a channel is associated with only one context.

The features InformixChannel adds to EOAdaptorChannel are as follows:

Generating Primary Keys

Each adaptor provides a database-specific implementation of the method primaryKeyForNewRowWithEntity: for generating primary keys. The InformixChannel's implementation uses a table named eo_sequence_table to keep track of the next available primary key value for a given table. The table contains a row for each table for which the adaptor provides primary key values. The statement used to create the eo_sequence_table is:

create table eo_sequence_table (

    table_name varchar(32,0),

    counter integer

)

InformixChannel uses a stored procedure named eo_pk_for_table to access and maintain the primary key counter in eo_sequence_table. The stored procedure is defined as follows:

create procedure

eo_pk_for_table (tname varchar(32))

returning int;

    define cntr int;

    update EO_SEQUENCE_TABLE

    set COUNTER = COUNTER + 1

    where TABLE_NAME = tname;

    select COUNTER into cntr

    from EO_SEQUENCE_TABLE

    where TABLE_NAME = tname;

    return cntr;

end procedure;

The stored procedure increments the counter in the eo_sequence_table row for the specified table, selects th counter value, and returns it. InformixChannel executes this eo_pk_for_table stored procedure from primaryKeyForNewRowWithEntity: and returns the stored procedure's return value.

To use InformixChannel's database-specific primary key generation mechanism, be sure that your database accommodates the adaptor's scheme. To modify your database so that it supports the adaptor's mechanism for generating primary keys, use EOModeler. For more information on this topic, see Enterprise Objects Framework Developer's Guide.

Method Types

Getting the cursor data area
- cursorDataArea
Setting the isolation level
- informixSetIsolationTo:
Setting the fetch buffer length
- setFetchBufferLength:
- fetchBufferLength

Instance Methods

cursorDataArea

- (struct informix_cursor *)cursorDataArea

If the channel is connected, returns an Informix-specific data structure describing characteristics of the channel. Otherwise, returns NULL.

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:

informixSetIsolationTo:

- (void)informixSetIsolationTo:(InformixIsolationLevel)isolationLevel

Sets to isolationLevel the isolation transaction level of the connection represented by the receiver.

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

Copyright © 1997, Apple Computer, Inc. All rights reserved.