Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11650

Re: Java DB rotation

Date 2012-01-30 21:12 -0500
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Java DB rotation
References <n7jei7582sh0m08frucvasubaaiplnvc2s@4ax.com>
Message-ID <4f274dff$0$285$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


On 1/30/2012 9:08 PM, Jim Lee wrote:
> 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

I can not see any any problems with construction the table
name every time you need it.

That string formatting will be insignificant compared to
the actual database operation.

And it will be far more expensive to read from a file.

So definitely #1.

Arne

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:08 -0800
  Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:12 -0500
    Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:14 -0500
      Re: Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:20 -0800
        Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:34 -0500
        Re: Java DB rotation Robert Klemme <shortcutter@googlemail.com> - 2012-01-31 08:36 +0100
    Re: Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:17 -0800
      Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:20 -0500
        Re: Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:23 -0800
          Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:31 -0500
  Re: Java DB rotation Martin Gregorie <martin@address-in-sig.invalid> - 2012-01-31 02:21 +0000
    Re: Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:24 -0800
      Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:32 -0500
        Re: Java DB rotation Robert Klemme <shortcutter@googlemail.com> - 2012-01-31 08:38 +0100
          Re: Java DB rotation Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-01-31 12:57 -0600
            Re: Java DB rotation Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-01-31 13:03 -0600
              Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-31 20:32 -0500
                Re: Java DB rotation Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-02-01 13:49 -0600
                Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-02-01 19:23 -0500
            Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-31 20:31 -0500
          Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-31 20:30 -0500
  Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:35 -0500
    Re: Java DB rotation Lew <noone@lewscanon.com> - 2012-01-30 22:54 -0800
  Re: Java DB rotation George Neuner <gneuner2@comcast.net> - 2012-02-02 14:05 -0500
  Re: Java DB rotation Rajiv Gupta <rajiv@invalid.com> - 2012-02-08 02:08 +1100

csiph-web