hibernate/hibernate-orm · error · UnsupportedOperationException

Database not known to define a current timestamp function

Error message

Database not known to define a current timestamp function

What it means

Error "Database not known to define a current timestamp function" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java:3467

	 * value from the database?
	 *
	 * @return True if the current timestamp can be retrieved; false otherwise.
	 */
	public boolean supportsCurrentTimestampSelection() {
		return false;
	}

	/**
	 * Is the command returned by {@link #getCurrentTimestampSelectString}
	 * treated as callable?
	 * <p>
	 * Typically, this indicates the use of the JDBC escape syntax.
	 *
	 * @return {@code} if the {@link #getCurrentTimestampSelectString} is
	 *         treated as callable; false otherwise.
	 */
	public boolean isCurrentTimestampSelectStringCallable() {
		throw new UnsupportedOperationException( "Database not known to define a current timestamp function" );
	}

	/**
	 * The command used to retrieve the current timestamp from the database.
	 */
	public String getCurrentTimestampSelectString() {
		throw new UnsupportedOperationException( "Database not known to define a current timestamp function" );
	}

	/**
	 * Does this dialect have an ANSI SQL {@code current_timestamp} function?
	 */
	public boolean supportsStandardCurrentTimestampFunction() {
		return true;
	}

	/**
	 * Is the result of {@code current_timestamp} stable i.e. does it always produce the same value

View on GitHub (pinned to fad1729dce)

Solutions

  1. Override currentTimestamp() in a custom dialect.
  2. Avoid the current_timestamp HQL function for this database.

When it happens

Trigger: Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: Database not known to define a current timestamp function.

Common situations: Common when running against a database whose dialect lacks this capability, when a mapping or HQL/Criteria query requests unsupported functionality, or when the wrong dialect is configured for the database in use. Error: Database not known to define a current timestamp function.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/a189341f3e34b0c6. Report an issue: GitHub.