heroku에서 실행되는 작은 무료 앱이 있습니다.heroku 현재 거래가 중단되었습니다.
간헐적으로 앱이 작동을 멈추고 화면에 기본 영웅 오류 페이지가 표시됩니다. 난 그냥 다음을 수행하고 내 컨트롤러에서
ActiveRecord::StatementInvalid (PGError: ERROR: current transaction is aborted, commands ignored until end of transaction block : SELECT * FROM "users" WHERE ("users"."password" = E'' AND "users"."userid" = E'') LIMIT 1): app/models/user.rb:5:in
authenticate'
login'
app/controllers/admin_controller.rb:6:in
을 :
user = User.authenticate(params[:storeid], params[:password])
및 사용자 모델에서
가 :def self.authenticate(userid, password)
user = self.find_by_userid_and_password(userid, password)
user
end
오류 메시지가 날 리드 내가 로그를 확인할 때 나는 다음을 참조 어떤 연결은 교수형에 처해 있고 결코 닫히지 않는다고 생각하는 것. 루비 앱에서 이런 경우가 있습니까?
내 응용 프로그램에는 find_by_sql을 사용하는 곳이 많이 있습니다. 우리가 명시 적으로 연결을 끊어야합니까? 이처럼
는 :
@sqlstmmt1 = "INSERT INTO addresses (\"line1\", \"line2\", city, state, zip, county) VALUES ('" + params[:line1] + "', '"+ params[:line2] + "', '"+params[:city]+ "', '" + params[:state] + "', '" + params[:zip]+ "', '" + params[:county]+"')"
sql = ActiveRecord::Base.connection();
sql.begin_db_transaction