General discussion

Locked

VB application recovery

By lam_cc ·
I have an app which is written in VB 4.0 which munches a lot of data from text files then data is manipulated and dumped to Oracle and Access (yes 2 databases). Problem is, this app is run on a rather old machine and resources on that machines is rather limited. The app would "freeze" the machine to point that I need to reboot the machine by turning it on and off. When this happens I have to restore 2 databases with backup data cos the app kind of stops in the middle of data manipulation. I have to find a way to solve this problem.
Okay I know giving that machine more resources would solve it but this has been ruled out. I was asked to write a script/procedure that would recover the app to the previous stage. i.e. If the app crashed, whenI restart the app, it would ask me "Would you like to continue processing last batch of data?". Could anyone please help ?

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB application recovery

by andrew In reply to VB application recovery

I think you'll need to build this functionality into the app itself. While the app is processing the data, it will have to persist status info to a file or db, which will record suff like the last row processed, byte pointer into the source file, etc. If the app finishes normally, it can delete this file on cleanup. If the app crashes, it can check for the existence of the file (after it's restarted), read it and pick up where it left off.

I would recommend porting the code to VB6 and rebuilding it. I seem to remember VB4 being pretty unstable.

Hope this helps.

Collapse -

VB application recovery

by Shanghai Sam In reply to VB application recovery

Thanks Andrew. Sounds like this is one of the ways to deal with my problem. Just another question want to ask you. How well will BeginTrans, CommitTrans and Rollback work in VB4 ? You have any experience running those commands? Some comments would help, many thanks again.

Collapse -

VB application recovery

by VinnyD In reply to VB application recovery

In VB you can write a procedure that creates a backup of the Access database before you start.

Then when you restart you can restore the access database from the backup copy.

I have done this before in VB and it works.

You just access the access database, it gives you are error, you trap the error and do the recover.

Can't help with the Oracle database. Never used on before.

Collapse -

VB application recovery

by Shanghai Sam In reply to VB application recovery

Thanks. We have tied in this function in the app already. I agree backing up the database method is good but since the app needs to process quite a bit of data. It would be hellish to restore the database and start again after the apps has been running for 2 hours. Hope you see what I mean.

Collapse -

VB application recovery

by andrew In reply to VB application recovery

I don't think there should be a problem with BeginTrans, etc. with VB4, since all the implementation of this functionality is in the MDAC libraries, not in VB itself. You may want to get the latest MDAC version.

While having sound transaction semantics is a good thing, it won't be a panacea; if your app crashes, the current transaction should still rollback, but you still won't know where to start processing when you restart.

You'll want to make the transactions as granular as possible, as opposed to starting a transaction, processing the entire db, then committing.

Hope this helps.

Collapse -

VB application recovery

by lam_cc In reply to VB application recovery

Thanks again Andrew

Collapse -

VB application recovery

by lam_cc In reply to VB application recovery

This question was closed by the author

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums