M
M
Muxauko2021-03-03 17:40:44
go
Muxauko, 2021-03-03 17:40:44

sqlite3 transactions?

Help defeat these damn goroutines and sqlite)
After working out, the code does not produce all 100 records,
40% of the records are lost and Rollback occurs.

https://play.golang.org/p/TpaZ2Bk_mwH

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Romses Panagiotis, 2021-03-03
@romesses

1. there should be one transaction, not 100
2. after the loop, you need to wait until all goroutines are completed (using sync.WaitGroup or channel).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question