Re: sqlce resources not released on application.exit()?
- From: "Chris Tacke, MVP" <ctacke.at.opennetcf.dot.com>
- Date: Thu, 4 Jun 2009 07:12:05 -0500
The correct way to shut down is to exit the Main function. If you have any threads created, you should signal them to shut down before doing so (setting IsBackground to true when you create them will usually do it automatically).
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"Scott Anderson" <ScottAnderson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:3E7AB735-5712-4CD9-85A9-532344C7ECAF@xxxxxxxxxxxxxxxx
Interesting...when I use Remote Process Viewer I can see that the process in
NOT shutting down after calling Application.Exit(). What is the correct way
to make sure the process is killed completely?
"Chris Tacke, eMVP" wrote:
After you call Application.Exit are you verifying that your app process is
actually shutting down (with something like Remote Process Viewer)?
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"Scott Anderson" <ScottAnderson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F2CD67D3-54EA-4BF7-8C65-9D9D26901017@xxxxxxxxxxxxxxxx
>I am not using Query Analyzer. The problem is intermittent but I have >seen
> this before: Error Code: 8007000E, which I've read is an out of memory
> error.
> If that is really the problem then it would be because resources aren't
> being freed up right? I am pretty certain I am closing all > connections,
> etc.
> How can I check if the application is really closed before restarting? > Is
> Application.Exit() non-deterministic? I thought it would release
> everything
> the app was using immediately every time.
>
> Thanks.
>
> "Simon Hart [MVP]" wrote:
>
>> A|re you accesing the database via Query Analyzer? although I think in >> CE
>> 3.5 Query Analyzer no longer opens the database for exclusive access.
>>
>> What exception are you getting? When you close you're app, check it is
>> actually closed before restarting.
>>
>> --
>> Simon Hart
>> Visual Developer - Device Application Development MVP
>> http://www.simonrhart.com
>>
>> "Scott Anderson" <ScottAnderson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
>> message
>> news:8E9368F6-21DD-42CF-BD8B-9FAAE31D3416@xxxxxxxxxxxxxxxx
>> > Hi-
>> >
>> > When I run my netcf 3.5 app, then click a button that executes
>> > application.exit(), then run the app again, I get an exception when
>> > trying
>> > to
>> > access the sqlce database. I am making sure that I close the
>> > connections
>> > and
>> > dispose sqlcecommands after I am done with them. Is there something
>> > else
>> > I
>> > need to do to make sure the resources are released on application >> > exit?
>> > Or
>> > could there be something else that would cause this?
>> >
>> > Thanks!
>>
.
- Follow-Ups:
- Re: sqlce resources not released on application.exit()?
- From: Scott Anderson
- Re: sqlce resources not released on application.exit()?
- References:
- sqlce resources not released on application.exit()?
- From: Scott Anderson
- Re: sqlce resources not released on application.exit()?
- From: Simon Hart [MVP]
- Re: sqlce resources not released on application.exit()?
- From: Scott Anderson
- Re: sqlce resources not released on application.exit()?
- From: Chris Tacke, eMVP
- Re: sqlce resources not released on application.exit()?
- From: Scott Anderson
- sqlce resources not released on application.exit()?
- Prev by Date: COM Port Delete
- Next by Date: Re: COM Port Delete
- Previous by thread: Re: sqlce resources not released on application.exit()?
- Next by thread: Re: sqlce resources not released on application.exit()?
- Index(es):