Hi,

I'm not sure of your environment, but here's some tidbits that might help:

If you app crashes mid-way (say due to a syntax error or an exception popped), the db can remain locked. And... if you are doing webby related work and calling sqlite and something crashes, the lock isn't released since the process that acquired the lock is still running (the web server). Sometimes restarting the webserver helps, other wise you have to delete the journal file.

I'm still working on bulletproofing an app, but you may wish to wrap your core code in a try/catch block and then close/commit/release the connection to make sure you don't lock the db by mistake.

hope this helps,

--nickg

On Jun 9, 2005, at 10:35 AM, Jay Sprenkle wrote:


I'm not familar with the wrapper you're using, but don't you have a
commit without a matching begin? Did you establish a lock on the table
before
trying to update? Are you updating a table that you currently are reading from?
As in:
select * from t;
for each result
  update t set field = blah;
next

On 6/9/05, Puneet Kishor <[EMAIL PROTECTED]> wrote:


I've been a reading a lot on the "database locked" problem, but still
need guidance trying to locate the source of my problem.

environment: DBI/DBD::SQLite (latest versions) with SQLite3 (3.2.1) on
Mac OS X (10.3.9).

I am trying to update a table via the web. The UPDATE in question is
the very first (and the only) DML statement. Yet, I get the "database
locked" error.

The sequence of commands is

my $sql = "UPDATE statement";
my $sth = $dbh->prepare(qq{$sql});
$sth->execute;
$dbh->commit;

My question is: could I set some kind of "trace" that tells me what is
going on with SQLite?

Many thanks.

--
Puneet Kishor






--
---
You a Gamer? If you're near Kansas City:
Conquest 36
https://events.reddawn.net

The Castles of Dereth Calendar: a tour of the art and architecture of
Asheron's Call
http://www.lulu.com/content/77264




Reply via email to