
在他们的维基页面中,他们提到:
Some gems can be troublesome: * pg (the postgres driver,make sure PG::Connection.isthreadsafe returns true)
我为Postgresql使用pg gem.
我的问题是:如何将PG :: Connection.isthreadsafe更改为true?
解决方法 gem调用此c库调用:PQisthreadsafe();
记录在这里:
http://www.postgresql.org/docs/8.2/static/libpq-threading.html
相关文件是这样的:
libpq is reentrant and thread-safe if the configure command-line
option –enable-thread-safety was used when the Postgresql
distribution was built.
因此,您需要重新编译libpg(或获取线程安全包,如果可用)以使其实际上是线程安全的.
总结以上是内存溢出为你收集整理的ruby-on-rails – 如何确保PostgreSQL驱动器是线程安全的全部内容,希望文章能够帮你解决ruby-on-rails – 如何确保PostgreSQL驱动器是线程安全的所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)