As mentioned, temp tables are connection based, not database based.

I can think of two ways of getting around this.

Expose your child thread database object to your main thread.  Then have
your main thread do what it needs to do with it.  I wouldn't entirely
recommend this as it breaks scope, not to mention, if your child thread
closes the database while your main thread is using it, you're getting a
run time crash unless you handle it.

The other option would be to skip temp tables and just use regular tables.
When you're done with it, drop the table.

On Tue, Oct 28, 2014 at 12:53 AM, Balance On I <balance...@gmail.com> wrote:

> Hi All,
>
> I have an application where I create a temp table/view in one thread. I
> then try to perform some operations in background and I don’t have access
> to those temp objects. I thought that those were process scoped. Is it
> possible to access temp tables/views from across threads?
>
> I am currently doing this in Objective-C and am using blocks to open a
> connection, perform operations, then close the connection in the background
> on a concurrent dispatch queue.
>
> Is there a better multi-threaded approach?
>
> Thanks,
> Carl
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to