Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Auto-fill date field

Hello all,
I have an event record, which has a timestamp field:
 
...
    @Temporal(TemporalType.TIMESTAMP)
    public Calendar getEventTime() {
        return eventTime;
    }
...

I would like to have the DB itself fill in the field when the entity is first persisted. This is important as I have a few servers talking to the same DB, and filling the timestamp in the java tier exposes the application to problems caused by  differences between servers' clocks (e.g. in the history table, email is received before it is sent).

Any ideas?
Thanks in advance,
Michael Bar-Sinai

p.s. Obviously, we have the systems team work on their NTP-clock-syncing stuff, but an application-level solution is always better :-)

Back to the top