Eduardo Morras <emorr...@yahoo.es> wrote:

> On Wed, 02 Jul 2014 12:02:27 +0100
> Grzegorz Sikorski <g.sikor...@kelvatek.com> wrote:
>
>> Hi,
>>
>> I am not sure if my previous email had reached the list, so I just
>> repeat it:
>>
>> I am developing sharding database using SQLite3 for embedded
>> application. My code works fine up to about 1020 connections to the
>> database. After around this number, I get an error "unable to open
>> database file". I double checked, permissions are OK and I think I
>> always properly close all connections and never open the same file
>> twice (I normally keep one connection opened for whole application
>> lifetime and open others on demand for each transaction). I found
>> this
>> topic:http://stackoverflow.com/questions/22801987/sqlite3-unable-to-open-database-file-ios
>> and I am not sure if there is any reason why keeping opened
>> connection in whole application lifetime is really something I should
>> do? I would prefer to open database only when it is needed, to avoid
>> risk of file corruption on power loss. Is there any known issue with
>> multiple open/close operations?
>
> 1020 simultaneus connections? Perhaps iOS exhausted del max. file descriptor 
> per process.

That's probably the problem.
On my Linux machine, I see that the limit for number of opened
file descriptors is 1024 by default:

$ ulimit -n
1024

But you can increase the limit. Ex:

$ ulimit -n 4096
$ ulimit -n
4096

$ help ulimit
ulimit: ulimit [-SHacdefilmnpqrstuvx] [limit]
    Modify shell resource limits.
...snip...
      -n        the maximum number of open file descriptors
...snip...

Regards
Dominique
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to