Re: [sqlite] detach failed with error code 1

2014-04-30 Thread dd
I have set busy time out for 5 seconds and given different names for every
attach and detaching database. still, this error is not getting fixed.
prepare, step and finalize are not throwing any errors.

What is the alternative solution for attach and detaching database? Thanks
in advance.


On Sun, Apr 20, 2014 at 9:16 PM, Simon Slavin  wrote:

>
> On 20 Apr 2014, at 12:58pm, dd  wrote:
>
> > Given different database name for in-memory database for every
> > iteration(looped for 1000 times). Still, it's throwing Database Locked at
> > least once on Windows, not on Mac/Linux. Is there any way to track this
> > issue? I am using 3.7.11. Any ideas?
>
> Technically this should not solve the problem, but I'm curious to know.
>
> Have you set a timeout value ?  If not, please set one to at least five
> seconds using either of these:
>
> 
> 
>
> I'm curious to know whether (a) this solves the problem or (b) it makes
> your loop of 1000 take longer.
>
> However, we do seem to still think that the error is in your code
> somewhere rather than in the SQLite library.  Are you checking the result
> returned by all calls for errors, rather than checking just the result
> returned by your DETACH ?  Check the result returned by every single
> _prepare(), _step() and _finalize() and other sqlite_ call in your code.
>
> Simon.
> ___
> 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


Re: [sqlite] detach failed with error code 1

2014-04-20 Thread Simon Slavin

On 20 Apr 2014, at 12:58pm, dd  wrote:

> Given different database name for in-memory database for every
> iteration(looped for 1000 times). Still, it's throwing Database Locked at
> least once on Windows, not on Mac/Linux. Is there any way to track this
> issue? I am using 3.7.11. Any ideas?

Technically this should not solve the problem, but I'm curious to know.

Have you set a timeout value ?  If not, please set one to at least five seconds 
using either of these:




I'm curious to know whether (a) this solves the problem or (b) it makes your 
loop of 1000 take longer.

However, we do seem to still think that the error is in your code somewhere 
rather than in the SQLite library.  Are you checking the result returned by all 
calls for errors, rather than checking just the result returned by your DETACH 
?  Check the result returned by every single _prepare(), _step() and 
_finalize() and other sqlite_ call in your code.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] detach failed with error code 1

2014-04-20 Thread dd
Given different database name for in-memory database for every
iteration(looped for 1000 times). Still, it's throwing Database Locked at
least once on Windows, not on Mac/Linux. Is there any way to track this
issue? I am using 3.7.11. Any ideas?


On Thu, Apr 17, 2014 at 5:11 PM, Richard Hipp  wrote:

> On Thu, Apr 17, 2014 at 9:08 AM, dd  wrote:
>
> > Dear Richard,
> >
> >   This is great api.
> >
> >   output:
> >
> >   (1) statement aborts at 5: [DETACH my_in_memory_db;] database
> > my_in_memory_db is locked
> >
>
> The DETACH failed because you have unfinalized statements using the
> attached database and you cannot detach a database file out from under a
> statement that is using that database file.  Because the DETACH failed,
> subsequent ATTACH statements cannot succeed because there would be a name
> conflict.
>
>
>
> >   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> > my_in_memory_db;] database my_in_memory_db is
> > already in use
> >   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> > my_in_memory_db;] database my_in_memory_db is already in use
> >   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> > my_in_memory_db;] database my_in_memory_db is already in use
> >   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> > my_in_memory_db;] database my_in_memory_db is already in use
> >
> >   there is a detach for every attach.  What could be the solution for
> this?
> >
> > Thanks,
> > dd
> >
> >
> >
> >
> > On Thu, Apr 17, 2014 at 2:58 PM, Richard Hipp  wrote:
> >
> > > Please turn on error logging (http://www.sqlite.org/errlog.html) and
> > > report
> > > back what error messages you are seeing.
> > >
> > >
> > > On Thu, Apr 17, 2014 at 6:47 AM, dd  wrote:
> > >
> > > > Hi All,
> > > >
> > > >   1. prepare, step, then finalize: Attach DATABASE '/full/path' as
> > > > 'my_in_memory_db';
> > > >   2. prepare, step, then finalize: Delete from
> my_in_memory_db.table_1
> > > > where primary_key = 'value';
> > > >   3. prepare, step, then finalize: DETACH my_in_memory_db;
> > > >
> > > >   Executed above three queries in loop for 100 times for empty
> database
> > > > (/full/path). It's throwing sqlite error 1 at some random iteration.
> Is
> > > it
> > > > correct way to implement attach and detach dbs?
> > > >
> > > > Thanks,
> > > > dd.
> > > > ___
> > > > sqlite-users mailing list
> > > > sqlite-users@sqlite.org
> > > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > > >
> > >
> > >
> > >
> > > --
> > > D. Richard Hipp
> > > d...@sqlite.org
> > > ___
> > > 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
> >
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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


Re: [sqlite] detach failed with error code 1

2014-04-17 Thread Richard Hipp
On Thu, Apr 17, 2014 at 9:08 AM, dd  wrote:

> Dear Richard,
>
>   This is great api.
>
>   output:
>
>   (1) statement aborts at 5: [DETACH my_in_memory_db;] database
> my_in_memory_db is locked
>

The DETACH failed because you have unfinalized statements using the
attached database and you cannot detach a database file out from under a
statement that is using that database file.  Because the DETACH failed,
subsequent ATTACH statements cannot succeed because there would be a name
conflict.



>   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> my_in_memory_db;] database my_in_memory_db is
> already in use
>   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> my_in_memory_db;] database my_in_memory_db is already in use
>   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> my_in_memory_db;] database my_in_memory_db is already in use
>   (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
> my_in_memory_db;] database my_in_memory_db is already in use
>
>   there is a detach for every attach.  What could be the solution for this?
>
> Thanks,
> dd
>
>
>
>
> On Thu, Apr 17, 2014 at 2:58 PM, Richard Hipp  wrote:
>
> > Please turn on error logging (http://www.sqlite.org/errlog.html) and
> > report
> > back what error messages you are seeing.
> >
> >
> > On Thu, Apr 17, 2014 at 6:47 AM, dd  wrote:
> >
> > > Hi All,
> > >
> > >   1. prepare, step, then finalize: Attach DATABASE '/full/path' as
> > > 'my_in_memory_db';
> > >   2. prepare, step, then finalize: Delete from my_in_memory_db.table_1
> > > where primary_key = 'value';
> > >   3. prepare, step, then finalize: DETACH my_in_memory_db;
> > >
> > >   Executed above three queries in loop for 100 times for empty database
> > > (/full/path). It's throwing sqlite error 1 at some random iteration. Is
> > it
> > > correct way to implement attach and detach dbs?
> > >
> > > Thanks,
> > > dd.
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> >
> >
> >
> > --
> > D. Richard Hipp
> > d...@sqlite.org
> > ___
> > 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
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] detach failed with error code 1

2014-04-17 Thread dd
Dear Richard,

  This is great api.

  output:

  (1) statement aborts at 5: [DETACH my_in_memory_db;] database
my_in_memory_db is locked
  (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
my_in_memory_db;] database my_in_memory_db is
already in use
  (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
my_in_memory_db;] database my_in_memory_db is already in use
  (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
my_in_memory_db;] database my_in_memory_db is already in use
  (1) statement aborts at 5: [ATTACH DATABASE '/full/path/info.db' AS
my_in_memory_db;] database my_in_memory_db is already in use

  there is a detach for every attach.  What could be the solution for this?

Thanks,
dd




On Thu, Apr 17, 2014 at 2:58 PM, Richard Hipp  wrote:

> Please turn on error logging (http://www.sqlite.org/errlog.html) and
> report
> back what error messages you are seeing.
>
>
> On Thu, Apr 17, 2014 at 6:47 AM, dd  wrote:
>
> > Hi All,
> >
> >   1. prepare, step, then finalize: Attach DATABASE '/full/path' as
> > 'my_in_memory_db';
> >   2. prepare, step, then finalize: Delete from my_in_memory_db.table_1
> > where primary_key = 'value';
> >   3. prepare, step, then finalize: DETACH my_in_memory_db;
> >
> >   Executed above three queries in loop for 100 times for empty database
> > (/full/path). It's throwing sqlite error 1 at some random iteration. Is
> it
> > correct way to implement attach and detach dbs?
> >
> > Thanks,
> > dd.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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


Re: [sqlite] detach failed with error code 1

2014-04-17 Thread Richard Hipp
Please turn on error logging (http://www.sqlite.org/errlog.html) and report
back what error messages you are seeing.


On Thu, Apr 17, 2014 at 6:47 AM, dd  wrote:

> Hi All,
>
>   1. prepare, step, then finalize: Attach DATABASE '/full/path' as
> 'my_in_memory_db';
>   2. prepare, step, then finalize: Delete from my_in_memory_db.table_1
> where primary_key = 'value';
>   3. prepare, step, then finalize: DETACH my_in_memory_db;
>
>   Executed above three queries in loop for 100 times for empty database
> (/full/path). It's throwing sqlite error 1 at some random iteration. Is it
> correct way to implement attach and detach dbs?
>
> Thanks,
> dd.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] detach failed with error code 1

2014-04-17 Thread dd
Hi All,

  1. prepare, step, then finalize: Attach DATABASE '/full/path' as
'my_in_memory_db';
  2. prepare, step, then finalize: Delete from my_in_memory_db.table_1
where primary_key = 'value';
  3. prepare, step, then finalize: DETACH my_in_memory_db;

  Executed above three queries in loop for 100 times for empty database
(/full/path). It's throwing sqlite error 1 at some random iteration. Is it
correct way to implement attach and detach dbs?

Thanks,
dd.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users