Running program at certain time, rollback if power failure or error

Y

yong

Hi,
I am working on a database project. Text files are sent to the server
throughout the day. The server will read the text files and write the data
into the database at a given time of the day. My questions are:

1) how to have the application to start conslidating the data at the
required time of the day. Is using servlet/EJB the best way to go, or I can
just write a Java apllication for it?

2)any info I can read up on implementating a roll back if the power supply
were to trip while the server is consolidating?

I hope I am clear.
Thanks to all
Yong
 
J

Jose Rubio

What does the consolidation steps includes (writing the data to the
database?)

So if I understand correctly, the server file receive the files and store
them until it's time to read them and put the data in the database.

I'll probably make it a Java app that executes at a certain time. If this is
Windows, you could use the scheduler to set the time you want it to run, in
Linux you can use the "at" command. It doesn't seem that you need to have an
app running all the time to check the clock.

You can ue the servlets to upload the files to the server. Not sure how you
are implmenting this part. or if it's already done.

For #2, are you saying that the computer just shut offs (not that the power
goes off, but you have a UPS to work for a couple of minutes?) You could set
up some kind of dirty bit file or something like that, that you can check to
see if the operation completed gracefully the last time around, if it didn't
you can clean up.

Hope it helps.
 
Y

yong

What does the consolidation steps includes (writing the data to the
database?)
So if I understand correctly, the server file receive the files and store
them until it's time to read them and put the data in the database.
Yes, you are right.

I'll probably make it a Java app that executes at a certain time. If this is
Windows, you could use the scheduler to set the time you want it to run, in
Linux you can use the "at" command. It doesn't seem that you need to have an
app running all the time to check the clock.
The server will be solely used for processing the text files
I was thinking if the number of text files get increased to tens of
thousands a day, the user may want the app to executes several times a day.
If this is the case, will the benefits of servlets/EJB (increased cost,
aside) outweights using Java App?


You can ue the servlets to upload the files to the server. Not sure how you
are implmenting this part. or if it's already done.
It's already pre-existing. So I don't need to worry.

For #2, are you saying that the computer just shut offs (not that the power
goes off, but you have a UPS to work for a couple of minutes?) You could set
up some kind of dirty bit file or something like that, that you can check to
see if the operation completed gracefully the last time around, if it didn't
you can clean up.
The consolidation process is running at night, unattended. So there will be
interruption if power supply were to trip (I think UPS will help but only if
the server is attended during the day).

Hope it helps.


--
Jose Rubio
Lead Consultant
Airphoria
http://www.airphoria.com

Thank you
 
J

Jose Rubio

I'll probably make it a Java app that executes at a certain time. If
this
is have
The server will be solely used for processing the text files
I was thinking if the number of text files get increased to tens of
thousands a day, the user may want the app to executes several times a day.
If this is the case, will the benefits of servlets/EJB (increased cost,
aside) outweights using Java App?
Given this scenario, I think the Java app is the right way to go. This is
running unattended, so there is no need to involve an app server like tomcat
in here. Just schedule the task to run at certain times using cron, windows
scheduler, etc. If the requirements arise to trigger an on demand
consolidation of the data, then I would create a couple of servlets that
call the same classes the Java app does. An you could also create a couple
of administrative pages/servlets to display the number of files that ares
waiting to be processed, when was the last time it ran, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top