Subject | Re: [IBO] Correct use of transactions for 24x7 |
---|---|
Author | Kyle Cordes |
Post date | 2001-10-07T20:37:39Z |
> I have a small application that is written in Builder 4, using[...]
> IBO3.6 and IB6. The application receives data from an external card-
> reader at a maximum rate of about 5 records per second. This data is
> placed in a single-table database. The client wants to see the last
> 50 records in a grid-type display, updated at least once a second.
> The application also need to approach 24x7 operation.
> I would have liked to close the transaction immediately afterA not-very-IBO-centric suggestion:
> fetching the data, but then the grid data is cleared - any
> suggestions will be appreciated.
Write code to do what you need done, using non-data-aware controls. For
example, you could use a StringGrid to show the user whatever the user
need to see; this could be totally decoupled from the code that posts
and commits the data in to the database. The database writing could
happen in a seperate thread, if desired.
Since 24x7 matters, it might even be worth putting the data capture,
database writing, and GUI in seperate EXE's:
* The data capture software would dump to a file, which could hold data
for a while even if the database is down.
* The database-writing software would read the file and write to the
database
* the GUI software would refresh/requery the last 50 records from the
database or from the file, as often as desired.
Here an IB / IBO-specific element: you need to make sure that you don't
keep one transaction going "forever".
[ Kyle Cordes * kyle@... * www.kylecordes.com ]
[ Developer, Consultant, Trainer: Java, Delphi, ASTA, etc.]
[ Visit the site for articles, links, BDE Alternatives ]
[ Guide, JBuilder Open Tools, and a Delphi Wiki, and more ]