When an EODatabaseContext needs a new channel because all its current channels are busy, it posts an EODatabaseChannelNeededNotification. If you add yourself as an observer of this notification, you can create new EODatabaseChannels on demand. (For more information on registering for notifications, see the NSNotification and NSNotificationCenter class specifications in the Foundation Reference.)
EODatabaseContext context; // Assume this existsIn Objective-C:
EODatabaseChannel channel = new EODatabaseChannel(context);
if (channel) context.registerChannel(channel);
EODatabaseContext *context; // Assume this existsThe EODatabaseChannel constructor can return null if no more channels can be associated with the EODatabaseContext. Similarly, in Objective-C, the EODatabaseChannel method initWithDatabaseContext: can return nil if no more channels can be associated with the EODatabaseContext. Some database servers and their corresponding adaptors don't support multiple channels per context. For example, the Sybase adaptor only supports one EODatabaseChannel per EODatabaseContext.
EODatabaseChannel *channel = [[EODatabaseChannel alloc]
initWithDatabaseContext:context];
if (channel) [context registerChannel:channel];
Table of Contents Next Section