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 6324895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:47:28+00:00 2026-05-24T16:47:28+00:00

I am receiving data through a com port continuously and doing some decoding. When

  • 0

I am receiving data through a com port continuously and doing some decoding. When decoding is done i have to store the results in a sql database. I am thinking since the decoding is done (in a while loop always running) dozens of times per second and data need to be stored to the database dozen of times every second if it is wise to open and close the connection to the sql server in each while loop or just leave it open and continue to write data to the database.
First of all is this possible? Secondly if the connection remains open can third party applications or computer access the database at the same time and read data as my programm stores data?

  • 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-05-24T16:47:30+00:00Added an answer on May 24, 2026 at 4:47 pm

    A database supports more than one concurrent connection, so yes it is very feasible in this scenario to leave the DB connection open – you will only lock out others if you have i.e. a long running query that results in row/ table locking. Just close the connection when you are done.

    Also consider though that most DBs (i.e. SQL Server) use connection pooling internally, so even though you close a DB connection it just goes back to the pool and is not physically closed – the pool manages the physical DB connections – this results in much better performance, so the impact of opening/closing connections rapidly is reduced.

    From MSDN:

    Connection pooling reduces the number of times that new connections
    must be opened. The pooler maintains ownership of the physical
    connection. It manages connections by keeping alive a set of active
    connections for each given connection configuration. Whenever a user
    calls Open on a connection, the pooler looks for an available
    connection in the pool. If a pooled connection is available, it
    returns it to the caller instead of opening a new connection. When the
    application calls Close on the connection, the pooler returns it to
    the pooled set of active connections instead of closing it. Once the
    connection is returned to the pool, it is ready to be reused on the
    next Open call.

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

Sidebar

Related Questions

I'm working on serial port, transmitting and receiving data to some hardware at 8bit
I have one device which sends data on COM port say on COM13. Now
I'm using c#, and have an open tcpip connection receiving data. Is it possible
I'm very new to sending data over a serial port through .net and I've
I'm designing a system which is receiving data from a number of partners in
My application is receiving email through SMTP server. There are one or more attachments
I have a Network Client class that is receiving a large binary block and
I need to programmatically (.NET 3.5, C#) monitor a SQL Server 2008 machine through
When receiving a bug report or an it-doesnt-work message one of my initials questions
I'm receiving Package Load Failure error when I open VS 2005 after I installed

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.