Ajay Pilaniya
12/27/2022, 2:56 PMNicolas Hourcard
12/27/2022, 2:58 PMAndrey Pechkurov
12/27/2022, 3:05 PMAjay Pilaniya
12/27/2022, 3:12 PMtry (var session = getSqlSessionFactory().openSession(ExecutorType.BATCH, false)) {
for (T entity : entityList) {
entity._setCa(System.currentTimeMillis());
var mapper = session.getMapper(getMapperClass());
mapper.insert(entity, PartnerId);
}
session.commit();
}
Andrey Pechkurov
12/27/2022, 3:15 PMAjay Pilaniya
12/27/2022, 3:16 PMentityList
Andrey Pechkurov
12/27/2022, 3:25 PMBEGIN;
INSERT INTO t VALUES(...); -- row 1
-- ...
INSERT INTO t VALUES(...); -- row N
COMMIT;
Ajay Pilaniya
12/27/2022, 4:20 PMAndrey Pechkurov
12/27/2022, 5:27 PMBEGIN;
to open a new transaction? Could you check?Ajay Pilaniya
12/28/2022, 3:14 AMsession.commit()
which I only call after 10k rows. So it starts txn, takes all rows and will commit all 10k rows together. I am not sure what’s the exact issue here due to which we are getting such bad performanceAndrey Pechkurov
12/28/2022, 7:25 AMAjay Pilaniya
12/28/2022, 8:43 AMtable busy reason = insert
So is it possible that even though quest send OK response to my write query but behind the scenes write might still be busy for few more seconds?Andrey Pechkurov
12/28/2022, 8:57 AMtable busy
problems like ILP + concurrent UPDATE. So, once we release it, you may want to switch to WAL-enabled tables and get rid of the workarounds.