Ruby mysql2 error when executing statements in rapid succession Ruby mysql2 error when executing statements in rapid succession sql sql

Ruby mysql2 error when executing statements in rapid succession


For some reason the only thing that ended up working and not needing the sleep 1 in between is the following:

@model = Model.new    Mysql2::Client.default_query_options[:connect_flags] |= Mysql2::Client::MULTI_STATEMENTS@model.connection.reconnect!