[whatwg] SQL API error handling

Ian Hickson ian at hixie.ch
Tue Oct 23 01:31:47 PDT 2007


On Thu, 18 Oct 2007, Scott Hess wrote:
> >
> > We don't have error codes for "the DOM has become corrupted" or for 
> > "the Window object's properties have become corrupted", why do we need 
> > one for "the Database's contents are corrupted"? Why can't the 
> > database contents simply not be corrupted in the first place?
> 
> One difference is that the database is persistent.  If the DOM became 
> corrupted, and you refresh the page or restart the browser, there's a 
> good chance that your DOM will no longer be corrupted.  If your Database 
> is corrupted and you refresh the page or restart the browser, your 
> Database is still corrupted.

I think the UA would be doing a poor job if it detected a database was 
corrupt and didn't do something about it before the next time it started.


> You almost need an "oncorruption" handler (or maybe something more 
> general).  Detecting that a database is corrupt from within an 
> individual statement's callback really isn't all that interesting, 
> there's nothing statement-specific that you'd want to do at that point.  
> But your oncorruption handler could do things like delete the corrupt 
> database and the three other databases which no longer make sense 
> without it, and reload the page.  The default handler could just delete 
> the database in question.

Yeah. We'll look into this in the next version, I guess.


On Thu, 18 Oct 2007, Køi¹tof ®elechovski wrote:
>
> It is normal that the disk gets full; the probability of this event is 1 
> for a consumer disk.  (Admittedly, the operating system can cry aloud 
> and refuse to do anything when the startup volume is about to overflow 
> but the database could be stored on another volume that is not protected 
> that way).  OTOH, it is an exceptional situation that data become 
> corrupt.  Therefore these two situations are not equivalent.

Indeed.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list