开发者

Rails - execute multiple queries in a single connection

How do I开发者_JS百科 issue multiple SQL queries in a single database connection in Rails? My problem is, I have multiple records(about 200 or more records) to be checked with the database table's existing records(I am checking composite primary key values) I could use ActiveRecord's exists? method in a single transaction block. But I don't know whether ActiveRecord uses a single connection to do this instead of creating multiple connections for each entry. All I need is a way to check records existence in a single connection with a maximum performance with lower overhead on both sides Mysql and Rails ?? Any suggestions for this please..


ActiveRecord uses a single persistant database connection.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜