[Webkit-unassigned] [Bug 25711] HTML5 Database becomes locked if a transaction is in progress when the page is refreshed.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 23 12:45:04 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25711


koivisto at iki.fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31408|review?                     |review-
               Flag|                            |




------- Comment #27 from koivisto at iki.fi  2009-06-23 12:45 PDT -------
(From update of attachment 31408)
It seems unfortunate that we have to add another database tracking mechanism.
There is already the DatabaseTracker and per Document set of databases. The
Document set seems to hold similar documents as the new per-db-thread set. 

> +        Database* database = task->database();
> +        if (database->opened()) 
> +            recordDatabaseOpen(database);
> +        else
> +            recordDatabaseClosed(database);
> +

This seems unoptimal. The task loop is not really the right place. Could you
remove this code, protect the m_databases set with a mutex and record the
databases directly from Database ctor/dtor? Then this

> +    DatabaseSet::iterator end = m_databases.end();
> +    for (DatabaseSet::iterator it = m_databases.begin(); it != end; ++it)
> +        (*it)->close();

could just check for closed() state before invoking close() (or it could be
done in close() itself)

Minor nits:

>      void close();
> +    bool opened() const { return m_open; }

Names should match. Rename m_open to m_opened.

> +    // If we sleep for more the 30 seconds while blocked on SQLITE_BUSY, give up.
> +    static const int MAX_SQLITE_BUSY_WAIT_TIME = 30000;

WebKit style is to use camel case for constants too. This does not seem to need
to be in header, top of the .cpp would be better.

r- for now, I think at least the recordDatabaseOpen/recordDatabaseClosed in
task loop should be cleaned up.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list