SQLITE TIMED OUT

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SQLITE TIMED OUT

sama446
I have a database with tables containing more than 1000 lines, when i write a query for sqlite database on MonoTouch. To read data into dataadapter and fill it into datatable. IOS throws an exception at the statement dataadaper.fill(datatable).(TIMED OUT). The query is a simple one to collect 4 columns with some simple where condition( where the ideal result would be 8 rows with 4 columns).

I'm not sure whether it is being thrown because the query execution is taking longer or dataadapter.fill(datatable) is not fast enough. Please let me know if there is any faster way to query data from SQLITE database.
Reply | Threaded
Open this post in threaded view
|

Re: SQLITE TIMED OUT

Alex White
why are you using an adapter are you updating the data?, I would use a reader as they are much quicker and then if some of the data needs to be updated, native sql update statements to update e.g. update tbldata set field1=test where primarykey=1

or use the orm of sql-net which is quick enough for most things.

is your data joined in the adapter if so make sure that you have indexes on all the relevant fields as this will speed things up.

ATB

Alex
On 31 Dec 2012, at 04:28, sama446 <[hidden email]> wrote:

> I have a database with tables containing more than 1000 lines, when i write a
> query for sqlite database on MonoTouch. To read data into dataadapter and
> fill it into datatable. IOS throws an exception at the statement
> dataadaper.fill(datatable).(TIMED OUT). The query is a simple one to collect
> 4 columns with some simple where condition( where the ideal result would be
> 8 rows with 4 columns).
>
> I'm not sure whether it is being thrown because the query execution is
> taking longer or dataadapter.fill(datatable) is not fast enough. Please let
> me know if there is any faster way to query data from SQLITE database.
>
>
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/SQLITE-TIMED-OUT-tp4657910.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: SQLITE TIMED OUT

Wally McClure
My questions are:
  1. How many records are in the database tables?
  2. What does the query look like?
  3. What has an index?

As for suggestions, I agree with Alex on the dataset v. datareader.  Datasets are great in a client server world with multiple users, you can disconnect the results and not have to worry about some type of inadvertent locks.  In the sqlite world, you typically have only 1 query at a time.  Plus, the dr is a tad bit faster depending on the records returned.

Wally

> From: [hidden email]

> Date: Mon, 31 Dec 2012 06:38:06 +0000
> To: [hidden email]
> CC: [hidden email]
> Subject: Re: [MonoTouch] SQLITE TIMED OUT
>
> why are you using an adapter are you updating the data?, I would use a reader as they are much quicker and then if some of the data needs to be updated, native sql update statements to update e.g. update tbldata set field1=test where primarykey=1
>
> or use the orm of sql-net which is quick enough for most things.
>
> is your data joined in the adapter if so make sure that you have indexes on all the relevant fields as this will speed things up.
>
> ATB
>
> Alex
> On 31 Dec 2012, at 04:28, sama446 <[hidden email]> wrote:
>
> > I have a database with tables containing more than 1000 lines, when i write a
> > query for sqlite database on MonoTouch. To read data into dataadapter and
> > fill it into datatable. IOS throws an exception at the statement
> > dataadaper.fill(datatable).(TIMED OUT). The query is a simple one to collect
> > 4 columns with some simple where condition( where the ideal result would be
> > 8 rows with 4 columns).
> >
> > I'm not sure whether it is being thrown because the query execution is
> > taking longer or dataadapter.fill(datatable) is not fast enough. Please let
> > me know if there is any faster way to query data from SQLITE database.
> >
> >
> >
> > --
> > View this message in context: http://monotouch.2284126.n4.nabble.com/SQLITE-TIMED-OUT-tp4657910.html
> > Sent from the MonoTouch mailing list archive at Nabble.com.
> > _______________________________________________
> > MonoTouch mailing list
> > [hidden email]
> > http://lists.ximian.com/mailman/listinfo/monotouch
>
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: SQLITE TIMED OUT

asavasamuel
In reply to this post by sama446
 sama446

This may help, here is Linq to SQLite.
https://www.kellermansoftware.com/p-47-net-data-access-layer.aspx