Note that there are some explanatory texts on larger screens.

plurals
  1. POToo many database connections created in rails 2.3.18 application
    primarykey
    data
    text
    <p>We have many models like the below one. </p> <pre><code>class User &lt; ActiveRecord::Base create_connection def create_connection # we have used this ActiveRecord::Base.configurations[current_environment] for connection_info self.establish_connection connection_info end end </code></pre> <p>After using many models of similar types, many database connections are being created for the remote database. So we are getting the below error message for remote Postgres database. </p> <pre><code>2013-12-04T12:18:28.360740+00:00 app[web.1]: FATAL: too many connections for role "ycjcwpowlrmvhi" </code></pre> <p>Actually we have two applications on heroku and each application accesses the other's database.</p> <p>How we can close these many database connection after executing the query?</p> <p>We are also getting the below error some times.</p> <pre><code>2013-12-06T09:36:27.952787+00:00 app[web.1]: Processing StaffController#index (for 202.45.6.95 at 2013-12-06 09:36:27) [GET] 2013-12-06T09:36:16.453533+00:00 heroku[router]: at=info method=GET path=/javascripts/application.js?1386322453 host=demomanager.herokuapp.com fwd="202.45.6.95" dyno=web.1 connect=1ms service=3ms status=200 bytes=5025 2013-12-06T09:36:32.935950+00:00 app[web.1]: 2013-12-06T09:36:32.935950+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::UnableToSend: SSL error: decryption failed or bad record mac 2013-12-06T09:36:32.935950+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull 2013-12-06T09:36:32.935950+00:00 app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d 2013-12-06T09:36:32.935950+00:00 app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum 2013-12-06T09:36:32.935950+00:00 app[web.1]: WHERE a.attrelid = '"tags"'::regclass 2013-12-06T09:36:32.935950+00:00 app[web.1]: AND a.attnum &gt; 0 AND NOT a.attisdropped 2013-12-06T09:36:32.935950+00:00 app[web.1]: ORDER BY a.attnum 2013-12-06T09:36:32.935950+00:00 app[web.1]: ): </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload