java - With a created by timestamp, is it better to have the DB manage it, or the application? -


We have our own standard Java app under development, and we are creating a lot of records (being in Hibernate in MySQL Institutions)

Now, I disagree with one of the more developers - I believe that Microsoft's CERITMTMTAMP should be the default in both those areas and then can be modified, both of which were replaced by the app Managed by app Wants to

Is there any solid reason for any decision? I can not see why you want to add more explicit steps in the code, unless for some reason you are worried about your server (db, app), inconsistent timestamp.

  • Use the DB timestamp if you can divide portability, if Too much small difference means something to apply and if you are going to be more than one application server / cluster, you may have trouble syncing nodes.
  • Use if you are not using deadbushes, it is not certain if you have used multiple databases - for example MySQL for production, HSQLDB for unit test.

If none of these arguments apply, then use that which is easy for you (or who are voting for more developers)

If you go for app handling, then with the suggestion of Pascal Thivent, @prefaidet , or your field is set with a default value like:

  Personal Calendar Date = Calendar. Est. Instance ();  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -