Describe the bug (https://github.com/spring-projects/spring-security/blob/main/acl/src/main/java/org/springframework/security/acls/jdbc/JdbcMutableAclService.java)

    private String classIdentityQuery = "call identity()";
    private String sidIdentityQuery = "call identity()";

In H2 version 2, the identity function was deleted. I changed these to "SELECT ID FROM ACL_CLASS/ACL_SID ORDER BY ID DESC LIMIT 1" as we only use H2 when testing.

To Reproduce Run call identity() in any H2 version 2 database. It will say: SQL Error [90022] [90022]: Function "IDENTITY" not found; SQL statement: CALL identity() [90022-210] Never used spring acl before, neither h2 so I can't help you much more.

Cheers!

Comment From: rwinch

Thanks for the report. Unfortunately, it isn't possible for the implementation to be compatible with every JDBC vendor. You can either inject custom queries to override classIdentityQuery, set LEGACY mode on and ensure that you are using H2 2.1.210 or better which has support for those functions, or write a custom implementation of the interface.

Related links:

  • https://groups.google.com/g/h2-database/c/RH06az2F75w/m/PZ_xQxkrBwAJ
  • https://github.com/eclipse-ee4j/eclipselink/issues/1393