For my Laravel 5.5.19 (PHP 7.1 and MySql 5.5.40) application developed with DataTables-Editor 1.7.4, I found the fantastic writeEdit event ("Data has been written to the database, but not yet read back, allowing the database to be updated before the data is gathered to display in the table"),
but when, in my writeEdit function, I try to execute an UPDATE to the same row I catch an SQL Exception :
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction (SQL: update wp_assegnazione_lotti set importo_da_fatturare = 900 where (id = rcaboni-100-110))
The writeEditor is very simple:
public function preUpdateOffer($editor, $id, $values) {
DB::table('wp_assegnazione_lotti')->where([['id', '=', $id]])
->update(['importo_da_fatturare' => '900']);
}
it seems we are still in transaction with the editor update and we cannot update the row.
The Database connection for editor is created for it and we not reuse the database connection used by Laravel.
Am I doing samething wrong ? or there is a bug ?****