Unable to successfully execute disk IO on the file system.

P

Peter B

Hi!

Im running a database SQL CE Database on a SD-card. After the handheld has
been in sleep mode, and I wake it up, my application tends to crash. I have
a consistent connection to the database, i.e. I don't close the connection
until the application is terminated.

Has anyone experienced crashing applications after PocketPC 2003 has been in
sleep/suspend mode? I have tested this on 2 machines, a HHP Dolphin 9500,
and a Dell Axim X5. The Dell hasn't shown this behaviour at all (except see
Note: below), while the Dolphin tends to crash more or less instantly after
I power it up again.

Managed Exceptions:
Error Code: 80004005
Message: An internal error occurred. Unable to successfully execute disk IO
on the file system.
Minor Err.: 25051
Source: Microsoft SQL Server 2000 Windows CE Edition

Error Code: 80004005
Access to the database file is not allowed
Minor Err.: 25039
Source: Microsoft SQL Server 2000 Windows CE Edition

Note: I am not executing any I/O when the handheld is set to suspendmode.

Since I don't experience this with my Dell Axim I suspect there is something
wrong/slow in the Dolphin. Has anyone else seen this behaviour??

br,

Peter
 
C

Chris Tacke, eMVP

When the device wakes, the SD card slot most ikely has to be reinitialized
and powered. My guess is that it happens too slowly and SSCE is trying to
access it before it comes back up.

-Chris
 
P

Peter B

Hi Chris, thanks for you reply.

I don't think the time it takes for the device to re-initialize the card is
an issue. I have tried waiting for a long time and I still get the same
devastating result.

Is the power functionality different depending on make? I.e. could it be
that a Dolphin cuts the power to the SD-card entirely when going into
suspend mode while for instance the Dell Axim doesn't?

I use a single SqlCeConnection object in my database class. It is connected
at startup and I only change the CommandText property when executing
different commands. I do this since creating new connection objects all the
time is time and memory consuming. But what happens to this connection when
the device is powered off? Could this be a reason? Is there a connection
between this and the idea of the SD-card beeing totally powered off during
suspend?

I am thinking about catching a "power on"-event and reconnect the
sqlconnection to see if this solves the problem. The problem is I don't know
how I do this, do you have anything like this in your WinAPI Chris? :)

Thanks,

Peter
 
C

Chris Tacke, eMVP

Absolutely. The power management implementation is all part of the OAL, so
it's very manufacturer dependent. I would expect the port to be completely
powered down in sleep mode, so when you wake again, the device needs to be
re-powered and the driver restarted. I would guess the exception is because
the folder is non-existent on wake up.
 
P

Peter B

But i still get the same exception even if I wait for a long time after I
wake the device up... wouldn't that mean the issue is somewhere else?

Wouldn't it be a fair guess that Dell also powers the card port down in
sleep mode? Even if the Dell is much faster in it's card initialization I
don't think that is the entire issue... (since I have waited for a long time
as I mentioned above).

Would a reconnection of a global sqlconnection be required?

/ Peter
 
C

Chris Tacke, eMVP

The point is that the CF internally has the connection open, and therefore
may be maintaining it in some way that is not exposed to your app. Maybe it
holds a handle. When the device goes to sleep, the slot is powered down. I
would assume the Dell does the same, but again, that's OEM dependent. When
you wake back up, everything has to be initialized. I'm not sure you have
any control over when the CF will again look at/for the data file, and if it
is using a handle, the handle may have become invalid.

Another example of this type of behavior is often seen with serial ports.
Some OEMs have drivers that don't do so well when you have a port open, then
do a sleep/wake cycle. The handle becomes invalid or the driver locks up.
Try opening a file on the card, performs some reads and writes, go to sleep
and wake without closing the file, then try to read and write again. That
will give you an indicator of how well the OEM did the driver. Based on
your observations, I'm betting the Dolphin fails the test and the Dell
passes.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Peter B said:
But i still get the same exception even if I wait for a long time after I
wake the device up... wouldn't that mean the issue is somewhere else?

Wouldn't it be a fair guess that Dell also powers the card port down in
sleep mode? Even if the Dell is much faster in it's card initialization I
don't think that is the entire issue... (since I have waited for a long time
as I mentioned above).

Would a reconnection of a global sqlconnection be required?

/ Peter

Chris Tacke said:
Absolutely. The power management implementation is all part of the OAL, so
it's very manufacturer dependent. I would expect the port to be completely
powered down in sleep mode, so when you wake again, the device needs to be
re-powered and the driver restarted. I would guess the exception is because
the folder is non-existent on wake up.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Peter B said:
Hi Chris, thanks for you reply.

I don't think the time it takes for the device to re-initialize the
card
is
an issue. I have tried waiting for a long time and I still get the same
devastating result.

Is the power functionality different depending on make? I.e. could it be
that a Dolphin cuts the power to the SD-card entirely when going into
suspend mode while for instance the Dell Axim doesn't?

I use a single SqlCeConnection object in my database class. It is connected
at startup and I only change the CommandText property when executing
different commands. I do this since creating new connection objects
all
the
time is time and memory consuming. But what happens to this connection when
the device is powered off? Could this be a reason? Is there a connection
between this and the idea of the SD-card beeing totally powered off during
suspend?

I am thinking about catching a "power on"-event and reconnect the
sqlconnection to see if this solves the problem. The problem is I
don't
know
how I do this, do you have anything like this in your WinAPI Chris? :)

Thanks,

Peter

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Chris Tacke, eMVP" <ctacke[at]Open_NET_CF[dot]org> wrote in message
When the device wakes, the SD card slot most ikely has to be reinitialized
and powered. My guess is that it happens too slowly and SSCE is
trying
to
access it before it comes back up.

-Chris


Hi!

Im running a database SQL CE Database on a SD-card. After the handheld
has
been in sleep mode, and I wake it up, my application tends to
crash.
I execute
disk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top