当我尝试从Rails调用存储过程时,出现以下异常:
ActiveRecord::StatementInvalid: Mysql::Error: PROCEDURE pipeline-ws_development.match_save_all can't return a result set in the given context: call match_save_all()
from /Users/otto/Projects/Futures/src/pipeline-ws/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:150:in `log'
from /Users/otto/Projects/Futures/src/pipeline-ws/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:281:in `execute'
from (irb):3
以下是您需要翻译的内容:
在Rails Wiki中有一篇页面讨论了一个解决MySQL适配器问题的补丁,但它已经过时,似乎不再起作用。
配置代码正确启用了存储过程,但仍存在连接在存储过程调用后失去同步的问题,并且新的call_sp
方法不再起作用。
有没有建议如何使其正常工作?
这是我使用的代码:
ActiveRecord::Base.connection("call storedproc()")
无论
storedproc()
返回结果与否,它都会抛出相同的异常。