PG::DupliacatePstatement: Error: prepared statement already exists

88 views
Skip to first unread message

Vivek Babu

unread,
Mar 31, 2016, 12:40:11 PM3/31/16
to rubyonra...@googlegroups.com
I am getting the following error in production environment

"PG::DupliacatePstatement: Error: prepared statement already exists"

Ruby version is 2.2.4 and
Rails version is 4.1.3

I have the following code in my unicorn.rb file:

before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT
instead'
Process.kill 'QUIT', Process.pid
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end

after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait
for master to send QUIT'
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end

I have added

prepared_statement: false

in database.yml file. In environments/production.rb file, I have

config.cache_classes = false
config.action_controller.perform_caching = false

Can anyone please suggest a solution for this error?


[1]: http://i.stack.imgur.com/Qzm7Z.jpg

Attachments:
http://www.ruby-forum.com/attachment/11326/fd35c989-0aca-488b-b57d-82ec642ae206.jpg


--
Posted via http://www.ruby-forum.com/.

Colin Law

unread,
Mar 31, 2016, 1:00:42 PM3/31/16
to Ruby on Rails: Talk
On 31 March 2016 at 17:39, Vivek Babu <li...@ruby-forum.com> wrote:
> I am getting the following error in production environment
>
> "PG::DupliacatePstatement: Error: prepared statement already exists"

Show us the lines of code that cause the problem.

Colin
Reply all
Reply to author
Forward
0 new messages