Uploaded image for project: 'Hibernate ODM'
  1. Hibernate ODM
  2. HIBERNATE-37

implement java.sql.Connection#getMetaData() to return MongoDB server basic info

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We need to implement this method for at least two reasons:

      • remove the default MongoDialect constructor, and expose only MongoDialect(DialectResolutionInfo), as supposed to be done according to the Hibernate ORM documentation (see https://github.com/mongodb/mongo-hibernate/pull/8#discussion_r1838874171);
        • Hibernate ORM can get MongoDB version info and conduct version checking (throwing exception if version < v6)
      • avoid the warning level exception during JDBC service initialization as below:

      ```

      15:45:19 [Test worker] WARN  o.h.e.j.e.i.JdbcEnvironmentInitiator - HHH000342: Could not obtain connection to query metadata
      org.hibernate.HibernateException: error performing isolated work
          at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:95)
          at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.getJdbcEnvironmentUsingJdbcMetadata(JdbcEnvironmentInitiator.j

      ```

      We don't need to return all metadata for a good portion of them is SQL specific. The goal here is to get DB version and unblock JDBC service initialization (without throwing a warning level exception).

            Assignee:
            nathan.xu@mongodb.com Nathan Xu
            Reporter:
            nathan.xu@mongodb.com Nathan Xu
            None
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: