Re: Memory problem - writing to database
From: Paul fpvt2 (Paulfpvt2_at_discussions.microsoft.com)
Date: 12/23/04
- Next message: smith: "Re: where is the Key in TreeView.NET?"
- Previous message: Paul fpvt2: "Re: Memory problem - writing to database"
- In reply to: Bonj: "Re: Memory problem - writing to database"
- Next in thread: Bonj: "Re: Memory problem - writing to database"
- Reply: Bonj: "Re: Memory problem - writing to database"
- Reply: Bonj: "Re: Memory problem - writing to database"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Dec 2004 11:57:05 -0800
Thank you.
>which is to open a new connection for every new piece of
> data, and importantly, make sure you close it as soon as the data is
> inserted.
Does not opening and closing db connection slow down the program ? Does it
take a lot of resource to keep opening and closing the db connection ?
"Bonj" wrote:
> > If I do not have the recordset open all the time, I will need to query the
> > database again to add a new record. I do not want to do this, because it
> > will
> > take a long time to query the database (the db can have up to 10 million
> > records).
>
> Don't use a recordset to add new data. Instead, fire off an "INSERT"
> statement.
>
> > I have to keep the connection open all the time also
>
> You don't.
>
> > , because data is coming
> > in every milliseconds, and as the data comes in, I need to write all of
> > them
> > to the database.
>
> Try my suggestion - which is to open a new connection for every new piece of
> data, and importantly, make sure you close it as soon as the data is
> inserted. The connection should be opened as late as possible and closed as
> soon as possible.
>
>
>
- Next message: smith: "Re: where is the Key in TreeView.NET?"
- Previous message: Paul fpvt2: "Re: Memory problem - writing to database"
- In reply to: Bonj: "Re: Memory problem - writing to database"
- Next in thread: Bonj: "Re: Memory problem - writing to database"
- Reply: Bonj: "Re: Memory problem - writing to database"
- Reply: Bonj: "Re: Memory problem - writing to database"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|