Closed tashemi closed 11 years ago
The Problem was the "wait timeout" setting in MySQL. But still it is interesting why plain sql via raw_exec() works fine and update via save method on Idiorm object causes delay that Mysql goes away. Is it so big difference in performance?
No. This is because Idiorm opens a connection (https://github.com/j4mie/idiorm/blob/master/idiorm.php#L225) for all it's interactions and re-uses (https://github.com/j4mie/idiorm/blob/master/idiorm.php#L1592) that connection. raw_execute()
on the other hand opens a connection each time it is called (https://github.com/j4mie/idiorm/blob/master/idiorm.php#L373).
@treffynnon thanks for response. now reason of this error looks completely clear for me.
I have a script where user can attach file to the record. File is stored separately (not in a database). When user does not attach file and click on "Save record" it works fine. When user attaches file it does next steps:
Script tries to save record, and I get this:
I found out 2 things:
Does Idiorm do something wrong?