private static void checkDataSource(final DataSource dataSource) {
        final CurrentDataSource currentDataSource;
        try {
            throw new RuntimeException();
        } catch (final RuntimeException e) {
            currentDataSource = new CurrentDataSource(dataSource, e.getStackTrace());
        }

        // Check thread usage
        CurrentDataSource currentThreadDataSource = DATA_SOURCE_THREAD_LOCAL.get();
        if (currentThreadDataSource != null && currentThreadDataSource.dataSource.equals(dataSource)) {
            LOGGER.error(() -> "Data source already in use by this thread:\n\n" +
                    currentThreadDataSource +
                    "\n\n" +
                    currentDataSource);
        }
        DATA_SOURCE_THREAD_LOCAL.set(currentDataSource);
    }
Converts a time in millis since epoch to a {@link Date}
stroom-db-util/src/main/java/stroom/db/util/JooqHelper.java