Skip to content

Batch update doesn't work with multiple threads #57

@matsdecker

Description

@matsdecker

I have an api that bulk updates but when there are multiple requests to the api i got an error that the table already exist.

It boils down to DateTime.Now.Ticks being identical in temp table name for concurrent requests/bulk updates.

I created a custom IQueryProvider by copying SqlQueryProvider and change line 86 as below and now the same test works.

from:
var tempTableName = "temp_" + tableName + "_" + DateTime.Now.Ticks;

to:
var tempTableName = "temp_" + tableName + "_" + Guid.NewGuid().ToString("N");

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions