0

I am working with FMDatabase in my iOS app but I am opening a new connection on almost every query that I need to do.

For example in my CategoryDAO getCategoriesForArticle method I open a new connection. In my ArticleDAO getArticle I open a new connection.

I was thinking on open just one connection in my AppDelegate and use this connection on all my queries. Would it be good? Or is it better to open a new connection just when I need it and then close that connection?

iVela
  • 1,160
  • 1
  • 19
  • 40

1 Answers1

0

Yes, just open one connection and consider using FMDatabaseQueue.

ccgus
  • 2,906
  • 23
  • 18