4 Copyright (C) 1999 MDlink online service center GmbH and Helge Hess
6 Author: Helge Hess (helge.hess@mdlink.de)
8 This file is part of the FB Adaptor Library
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Library General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
20 You should have received a copy of the GNU Library General Public
21 License along with this library; see the file COPYING.LIB.
22 If not, write to the Free Software Foundation,
23 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 // $Id: FBContext.m 1 2004-08-20 10:38:46Z znek $
31 @implementation FBContext
33 static FBContext *context = nil;
35 + (FBContext *)activeContext {
39 - (void)channelDidInit:_channel {
40 if ([channels count] > 0) {
41 [NSException raise:@"TooManyOpenChannelsException"
42 format:@"SybaseAdaptor10 only supports one channel per context"];
44 [super channelDidInit:_channel];
47 - (BOOL)primaryBeginTransaction {
51 - (BOOL)primaryCommitTransaction {
52 FrontBaseChannel *channel;
56 channel = [[channels lastObject] nonretainedObjectValue];
57 //NSLog(@"committing channel %@", channel);
58 result = [channel evaluateExpression:@"COMMIT"];
63 - (BOOL)primaryRollbackTransaction {
64 FrontBaseChannel *channel;
68 channel = [[channels lastObject] nonretainedObjectValue];
69 //NSLog(@"rolling back channel %@", channel);
70 result = [channel evaluateExpression:@"ROLLBACK"];
75 - (BOOL)canNestTransactions {
81 - (id)copyWithZone:(NSZone *)zone {
82 // copy is needed during creation of NSNotification object
88 @implementation FrontBaseContext
91 void __link_FBContext() {
92 // used to force linking of object file