// To apply this path just replace the 2 following functions of PostgreSQL.m by these versions: + (PostgreSQL *)newPostgreSQLConnection { PostgreSQL *result = nil ; if ([gFreePool count] > 0) { result = [[gFreePool lastObject] retain] ; [gFreePool removeLastObject] ; } else { result = [[PostgreSQL alloc] init] ; } return [result autorelease] ; } - (PostgreSQL *)clone:(int *)resultCode { *resultCode = 0 ; if (_debugMode) NSAssert(_conn != nil, nilConnectionMsg) ; if (_conn == nil) return nil ; PostgreSQL *conn = [PostgreSQL newPostgreSQLConnection] ; // autoreleased object if ([conn connectToDatabase:[self databaseName] onHost:[self hostName] login:[self loginName] password:[self password] return:resultCode]) return conn ; [PostgreSQL releasePostgreSQLConnection:conn] ; return nil ; }