J
Jim Lee
I have a Java server controller that read/write to Database table
Java server will start read / write to a new DB table every
week/monday
e.g.
table-1-2-2012
table-1-9-2012
table-1-16-2012
table-1-23-2012 ... etc
I think of 2 ways to do the DB table rotation
1) check the server timestamp, if today's date is week of 1-23-2012,
then read/write to table-1-23-
2012
2) have a unix corn job run every monday to generate a text file on
Java server with DB table named on
that date - on each Java request, check the text file's table name -
then read/write to that DB table
any other solution to DB table rotation?
the first way check timestamp have a drawback when server's time is
not set to correct time, since
there are many Java server running for load balance, it's not a good
idea.
the second way is a better solution, but request additional setup -
cron job
Java server will start read / write to a new DB table every
week/monday
e.g.
table-1-2-2012
table-1-9-2012
table-1-16-2012
table-1-23-2012 ... etc
I think of 2 ways to do the DB table rotation
1) check the server timestamp, if today's date is week of 1-23-2012,
then read/write to table-1-23-
2012
2) have a unix corn job run every monday to generate a text file on
Java server with DB table named on
that date - on each Java request, check the text file's table name -
then read/write to that DB table
any other solution to DB table rotation?
the first way check timestamp have a drawback when server's time is
not set to correct time, since
there are many Java server running for load balance, it's not a good
idea.
the second way is a better solution, but request additional setup -
cron job