Inheritance: MongoRequestMessage
Example #1
0
        private MongoReplyMessage <TDocument> GetMore()
        {
            var connection = AcquireConnection();

            try {
                int numberToReturn;
                if (positiveLimit != 0)
                {
                    numberToReturn = positiveLimit - count;
                    if (cursor.BatchSize != 0 && numberToReturn > cursor.BatchSize)
                    {
                        numberToReturn = cursor.BatchSize;
                    }
                }
                else
                {
                    numberToReturn = cursor.BatchSize;
                }

                using (
                    var message = new MongoGetMoreMessage(
                        connection,
                        cursor.Collection.FullName,
                        numberToReturn,
                        openCursorId
                        )
                    ) {
                    return(GetReply(connection, message));
                }
            } finally {
                cursor.Server.ReleaseConnection(connection);
            }
        }
Example #2
0
        private MongoReplyMessage <TDocument> GetMore()
        {
            try {
                int numberToReturn;
                if (positiveLimit != 0)
                {
                    numberToReturn = positiveLimit - count;
                    if (cursor.BatchSize != 0 && numberToReturn > cursor.BatchSize)
                    {
                        numberToReturn = cursor.BatchSize;
                    }
                }
                else
                {
                    numberToReturn = cursor.BatchSize;
                }

                using (
                    var message = new MongoGetMoreMessage(
                        cursor.Server,
                        cursor.Collection.FullName,
                        numberToReturn,
                        openCursorId
                        )
                    ) {
                    return(GetReply(message));
                }
            } catch {
                try { ReleaseConnection(); } catch { } // ignore exceptions
                throw;
            }
        }