English 中文(简体)
数据库的读出和写出超时是否是活动记录独有的, 还是 Mysql 本地的?
原标题:Are database read_timeout and write_timeout unique to ActiveRecord or native to mysql?

活动 Record 允许您配置数据库的读出时间和写出时间值, 例如 :

production:
  adapter: mysql
  encoding: utf8
  database: mydb
  pool: 5
  username: myuser
  password: mypass
  host: myhost
  write_timeout: 2
  read_timeout: 10

读出和写出“ 活动记录” 是独一无二的吗? 或者说, “ 活动记录” 中的那些部分是独有的? 我知道, Mysql 的概念是innodb_lock_wait_timeout , 但我不相信这与查询超时是一样的。

谢谢!

问题回答

我从未使用过我的sql 宝石。但我想你可以看到我的sql 变量, 这些变量被这样的ActiveRecord使用过。

> ActiveRecord::Base.connection.execute( show variables like "%timeout%" ).to_a
=> [["connect_timeout", "10"],
 ["delayed_insert_timeout", "300"],
 ["innodb_flush_log_at_timeout", "1"],
 ["innodb_lock_wait_timeout", "50"],
 ["innodb_rollback_on_timeout", "OFF"],
 ["interactive_timeout", "28800"],
 ["lock_wait_timeout", "31536000"],
 ["net_read_timeout", "30"],
 ["net_write_timeout", "60"],
 ["rpl_stop_slave_timeout", "31536000"],
 ["slave_net_timeout", "3600"],
 ["wait_timeout", "2147483"]]




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签