database connection (open/close) performance -


i've doubts database connections:

  1. should open , close database every time execute query? (it's every time)
  2. if i'm downloading json files @ same time, on it's onload function, while i'm running insert querys (some times @ same time), lets 1st insert function done, if close database , 2nd function still inserting data, closing 1st database connection affect 2nd one?

(note these 2 separated functions, running @ same time, depending on onload function , size of json file data)

  1. if i'm using database connections, what's best approach in order avoid memory leaks , consume less memory?

  1. check here. says, in mobile app, don't use connection pooling. should close connection every time after you're done dealing it. might execute multiple queries @ once. in case, of course keep connection open until executed.

  2. no.

  3. use alloy models. alloy handles best database practices you.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -