[yunqa.de] Re: SQLite Error 10 - disk I/O error after the PC is come back from hibernation mode

  • From: Edwin Yip <edwin.yip@xxxxxxxxxxxxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Sat, 16 Jul 2011 18:29:38 +0800

Hi Ralf,

Yes, such an error shouldn't be happen in the first place, not sure if it's
coming from the SQLITE lib. Or the windows core...

"Maybe it would be easier to
cleanly close any open projects (and databases) on Windows sleep and
re-open them on wakeup?".

That's what I've done and seems to be working. Thanks.

On Fri, Jul 15, 2011 at 5:56 PM, Delphi Inspiration <delphi@xxxxxxxx> wrote:

> On 15.07.2011 08:09, Edwin Yip wrote:
>
> > FYI, I found a solution but I'm not sure if it will work - close the DB
> > connection before the system is entering sleep mode, and reopen it after
> > the system is resumed.
> > Ralf must have his insightful comments. :)
>
> Thanks for the leap of faith, but I am not well experienced with Windows
> hibernation.
>
> Still, I am surprised to read that Windows hibernation apparently closes
> existing file handles. Especially so as this MSDN reference
>
>  http://msdn.microsoft.com/en-us/library/aa373229%28v=VS.85%29.aspx
>
> states that hibernation saves "the state of the operating system,
> applications, and open documents". Does "open documents" excludes
> (database) file handles?
>
> I searched the web for how other applications handle your problem but
> could not find any relevant documents. Are your users suffering from a
> Windows hibernation problem? Or are closed (database) file handles
> indeed the expected behavior after the system wakes up from sleep?
>
> > ref: http://www.mail-archive.com/sqlite-users@xxxxxxxxxx/msg55626.html
>
> This sounds like good advice, but before you close your database you
> must finalize all prepared statements. This is relatively easy thanks to
> sqlite3_next_stmt(), which allows to iterate over all statements.
>
> Unfortunately, re-preparing closed statements after the system wakes up
> is more difficult as are probably in various parts of the software.
>
> In conclusion, this is not a simple task. Maybe it would be easier to
> cleanly close any open projects (and databases) on Windows sleep and
> re-open them on wakeup? Or even prevent the system from entering sleep
> if your application is running?
>
> Ralf
> _______________________________________________
> Delphi Inspiration mailing list
> yunqa@xxxxxxxxxxxxx
> //www.freelists.org/list/yunqa
>
>
>
>


-- 
Best Regards,
Edwin Yip

Mind Mapping is as Effortless as Typing
http://www.InnovationGear.com

Other related posts: