Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8096409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:26:37+00:00 2026-06-05T21:26:37+00:00

I am using System.Data.SQLite to store my program’s data and settings (in a WPF

  • 0

I am using System.Data.SQLite to store my program’s data and settings (in a WPF Ribbon application).

When you open the program it prompts you to choose a SQLite databse to open, then it reads several settings (Project Name, Last time opened, etc) from the settings table in the SQLite database.
When the application is closed, in the RibbonWindow.Closing event, it calls SQLiteConnection.Close().

Users can also close a database and open a new one.

For some reason, these settings can sometimes take several seconds to show up in the project information view. If a user clicks the application close button during this process or closes the project file to allow them to open a different one, an InvalidOperationException is thrown with the message Database is not open.

What is the best way to just interrupt every operation when the program is closed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:26:37+00:00Added an answer on June 5, 2026 at 9:26 pm

    To turn on connection pooling in SqlLite put pooling = true; in the connection string. It’s an ADO.Net facility, nothing to do with the backend as such.

    If you use that, instead of passing a connection to the thread, pass the connection parameters. Then each thread will manage it’s own connection.

    If you don’t want to do that. Then you have options.

    Wait until the thread(s) have finished in a loop, bit crap that unless they are very short.

    Busy try again later. Ho hum, user will probably give your app a three fingered salute and kill it anyway.

    Kill the thread(s), ugh!

    Get thread to create it’s own non pooled connection, and then Dispose of it. NB You can overload a DBMS, if you hammer away creating connections.

    Add a boolean property, set it when you close the connection. Don’t close the connection unless it’s not set.

    So try connection pooling, it is then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF Application using Fluent NHibernate 1.0 RTM and System.Data.SQLite 1.0.65 that
I am using the System.data.sqlite.dll in my vb.net program. And for the life of
I have been using the System.Data.SQLite provider for my application. When I try to
I am using the official System.Data.SQLite ADO.NET provider for my application, and I am
I'm using Visual Studio 2008, C#, SQLite via System.Data.SQLite with SubSonic 3. My application
Just some background, sorry so long winded. I'm using the System.Data.SQLite ADO.net adapter to
I am using SQLite from system.data.sqlite.org We need to access the database from many
I downloaded System.Data.SQLite , and tried to compile the following sample code. using System;
I'm going to give an example of using System.Data.SQLite.DLL which is a mixed assembly
I'm trying to insert non-latin data into sqlite database using bind variables using System.Data.SQLite.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.