If I Fork a process in ruby, do I need to reconnect to Mysql DB? -


i'm using following environment.

  • rails 3.1
  • unicorn
  • mysql

i have fork process wich generate invoces. people told me use

activerecord::base.connection.reconnect! 

because drivers lost connection fork... looked information i'm more confused before... here comes doubts:

1 what's difference between using

activerecord::base.connection.reconnect! 

and

::activerecord::base.clear_all_connections! 

before forking ,

::activerecord::base.establish_connection 

as shown here? mysql, using fork in ruby

2 should always?

if answer yesthere place put "fork configuration"?

3 what's happen connection when forked process ends? should close it? or close automatically? , what's append father's process connection?

4 needed database connections?

i have read somewhere postgres db...

thank you

no, point of view dont have reconnect.. have connect if want access different database, far know rails handles reconnect own mysql.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -