After upgrade to 6.3.1 I get warning HHH90000025

Hi,

after upgrading from 6.2.8 to 6.3.1 I get the warning
HHH90000025: MariaDBDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default). I use MariaDB 10.6. If I understood correctly, this warning should only occur if I use a too specific deprecated dialect such as MariaDB106Dialect.

In hibernate.cfg.xml I have the line <property name="dialect">org.hibernate.dialect.MariaDBDialect</property>.

Is this correct? If yes, can I just remove that line and how does Hibernate detect the correct dialect?

PS: I also just experienced a warning from org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess with MariaDB 10.6: HHH000444: Encountered request for locking however dialect reports that database prefers locking be done in a separate select (follow-on locking); results will be locked after initial query executes. The method useFollowOnLocking() is implemented in org.hibernate.dialect.Dialect (always returns false) and is neither overwritten in MySQLDialect nor MariaDBDialect. The query code looks like this:

CriteriaQuery<Integer> criteria = builder.createQuery(Integer.class);
Root<TestCount> root = criteria.from(TestCount.class);
criteria.select(builder.sum(root.get(TestCount_.timesExecuted)));
criteria.where(builder.and(root.get(TestCount_.test).in(submission.getTask().getTests()), builder.equal(root.get(TestCount_.user), participation.getUser())));
Query<Integer> query = session.createQuery(criteria);
query.setLockMode(LockModeType.PESSIMISTIC_WRITE);
Integer testCount = query.uniqueResult();

this correct? If yes, can I just remove that line and how does Hibernate detect the correct dialect?

Yes, you can remove <property name="dialect">org.hibernate.dialect.MariaDBDialect</property>. Hibernate will determine the dialect based on the JDBC metadata.

I also just experienced a warning from

You are using locking LockModeType.PESSIMISTIC_WRITE even though you are using an aggregate function. The warning is a false positive, because you’re actually not selecting an entity so there is no follow on locking done. You can create a Jira ticket for this.

Cross-ref: Hibernate ORM - Issues - Hibernate JIRA