diff --git a/ebean-api/src/main/java/io/ebean/config/dbplatform/h2/H2HistoryTrigger.java b/ebean-api/src/main/java/io/ebean/config/dbplatform/h2/H2HistoryTrigger.java index 2867ca06c..d6c74df1f 100644 --- a/ebean-api/src/main/java/io/ebean/config/dbplatform/h2/H2HistoryTrigger.java +++ b/ebean-api/src/main/java/io/ebean/config/dbplatform/h2/H2HistoryTrigger.java @@ -5,6 +5,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.*; +import java.time.LocalDateTime; import java.util.Arrays; /** @@ -76,7 +77,7 @@ public class H2HistoryTrigger implements Trigger { public void fire(Connection connection, Object[] oldRow, Object[] newRow) throws SQLException { if (oldRow != null) { // a delete or update event - Timestamp now = new Timestamp(System.currentTimeMillis()); + LocalDateTime now = LocalDateTime.now(); oldRow[effectEndPosition] = now; if (newRow != null) { // update event. Set the effective start timestamp to now. diff --git a/ebean-test/src/test/java/io/ebeaninternal/dbmigration/DbMigrationTest.java b/ebean-test/src/test/java/io/ebeaninternal/dbmigration/DbMigrationTest.java index 9c2dc2d6e..7d7ea9c4c 100644 --- a/ebean-test/src/test/java/io/ebeaninternal/dbmigration/DbMigrationTest.java +++ b/ebean-test/src/test/java/io/ebeaninternal/dbmigration/DbMigrationTest.java @@ -249,12 +249,12 @@ public class DbMigrationTest extends BaseTestCase { } private void sleepOneMilli() { - try { - // bit of a hack for H2HistoryTrigger with JDK 11+ JVMs, probably need more than millis precision for H2 history - Thread.sleep(1); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } +// try { +// // bit of a hack for H2HistoryTrigger with JDK 11+ JVMs, probably need more than millis precision for H2 history +// Thread.sleep(1); +// } catch (InterruptedException e) { +// throw new RuntimeException(e); +// } } private void createHistoryEntities() {