Subject Re: Re: [IBO] How to retrive information without increasing transaction count
Author GOVINDKRISHNA
>------------------Original Message-----------
>
>From : Svein Erling Tysvaer <svein.erling.tysvaer@...>
>To : IBObjects@yahoogroups.com
>Date : 11/07/2003 4:11:01 PM
>Subject : Re: [IBO] How to retrive information without increasing transaction count

>Now, why would anyone want to issue a 'SELECT COUNT(*) FROM TABLE' every
>twentieth second? How could that possibly be useful?

>Set

I will explain what I am doing - I would be happy to hear suggestions on better ways to implement this.

Basically I have a mail server which downloads mail for multiple users. Puts it into a database.
Users connect to the database to see their mail.

I want to pop up a small box saying 5 new mails etc.

Initially I had table like this.

ID
UserID
NumNewMails

Whenever I downloaded a mail I would update NumNewMails. Every Twenty seconds I would check what the value of the field was and pop up the message 5 new mails and set NumNewMails to 0. This obviously led to update conflicts all the time.

So changed the table to (actually on the basis of some posts that I saw on this forum)

UserID

whenever a mail is downloaded against a user. i insert a record in the table with that userID.

From the client Every twenty seconds I count how many records there are with a particular id. Pop up a box saying 5 new mails or whatever. Then delete all records with that id.

Thanks for the attention

GK