Working with the DataBase remote datetime (JPA)

A few days ago i decided to pick up work on a simple web-game i once tried to created when i was 15 (see related: Generating isometric tiles and slopes). And while working on it i decided the architecture should be able support multiple workers performing on a single database. As a consequence i required all my worker’s to be able to all use the same datetime.

Now as i’m not in control of the host machines to actually perform a time-sync, i figured i should best use the remote-database time as the single truth.

I ended up writing the following utility class, i’m really curious on what you guys think of it.

note: Unfortunately no generic JPA query, but one specific to mysql

 

One thought on “Working with the DataBase remote datetime (JPA)

Leave a Reply

Your email address will not be published. Required fields are marked *