Skip to content

How buffer works? #1328

@rocketRobin

Description

@rocketRobin

In read me, it says

Dapper's default behavior is to execute your SQL and buffer the entire reader on return. This is ideal in most cases as it minimizes shared locks in the db and cuts down on db network time.

And I saw the code

    public static IEnumerable<T> Query<T>(this IDbConnection cnn, CommandDefinition command)
    {
        var data = QueryImpl<T>(cnn, command, typeof(T));
        return command.Buffered ? data.ToList() : data;
    }

I dont't really understand why buffedred can minimizes shared locks in the db and cuts down on db network time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions