Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Create in two goroutines #33

Closed
norguhtar opened this issue Feb 15, 2022 · 1 comment
Closed

Run Create in two goroutines #33

norguhtar opened this issue Feb 15, 2022 · 1 comment
Assignees

Comments

@norguhtar
Copy link

Description

When i try use Create for batch as discribed in README it work fine. But when i run Create in two goroutines simultaneously this run transaction in second goroutne, and this broken. In logs i'm get

[clickhouse][connect=3][begin] tx=false, data=false
[clickhouse][connect=3][commit] tx=true, data=false

And got error

data request has already been prepared in transaction

If i'm disable transaction support via gorm. Just add

SkipDefaultTransaction: true

I can't use batch mode

insert statement supported only in the batch mode (use begin/commit)

But clickhouse not suport transaction. But if i try use batch fro clickhouse i should enable transaction. It's really strange thing.

@jinzhu
Copy link
Member

jinzhu commented Jul 4, 2022

Can you create a reproducible PR?

@jinzhu jinzhu closed this as completed Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants