Joe Stump <[EMAIL PROTECTED]> wrote:
> I've read through the docs and I'm completely perplexed as to what's  
> going on here. I've got an install of Trac (which uses sqlite3). I  
> can query the database without issue using PHP's PDO extension.  
> However, when I go to *update* any records my PHP script takes  
> upwards of 2 minutes to run, returns true, but doesn't modify any data.
> 
> Here's a snippet of my code:
> 
>              $sql = "UPDATE ticket_custom
>                      SET value = ?
>                      WHERE ticket = ? AND
>                            name = ?";
>              $stmt = $db->prepare($sql);
>              $stmt->bindParam(1, $i, PDO::PARAM_STR);
>              $stmt->bindParam(2, $row['ticket'], PDO::PARAM_INT);
>              $stmt->bindParam(3, $pField, PDO::PARAM_STR);
>              $result = $stmt->execute();
> 
> $result is true according to my var_dump() ... The odd part is that  
> the query fails to update the data from the command line as well - if  
> I can run it, which is rare since 90% of the time it says the  
> database is locked (not likely since I'm the only one using it).
> 

I don't know much about Trac. Can you show us the schema?  
In particular, it would really be nice to know what indices 
are on the ticket_custom table.

Though I don't know anything about Trac internals, I get the
impression from what I've seen posted in various newsgroups
that it hammers on the database pretty hard.  People keep complaining
about concurrency issues when using SQLite and switch to PostgreSQL.
CVSTrac also uses SQLite and the instance of CVSTrac running
on the www.sqlite.org website takes 80K hits/day running on 
a 1/16th slice of a server and seems to do just fine, so it 
is not at all clear to me why Trac is having such problems.  
I also hear (and this is just a rumor mind you) that Trac 
takes several seconds to render a timeline versus milliseconds 
for CVSTrac.  I can only conclude that Trac must be doing a 
whole lot more behind the scenes than CVSTrac does.  Trac 
certainly have better eye candy - I guess that doesn't come
for free...

I also do not understand why the database is locked.  Are you
sure you don't have a hung Trac process doing something to
the database in the background?  You're running on a local
filesystem and not on an NFS mount, right?

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to