nebula-contrib / nebula-jdbc

The JDBC connector for Nebula Graph.
41 stars 15 forks source link

impl ResultSetMetaData.getColumnLabel + fix getInstance #43

Closed cdalexndr closed 1 year ago

cdalexndr commented 1 year ago

ResultSetMedatada.getColumnLabel() is used in spring's DataClassRowMapper: https://github.com/spring-projects/spring-framework/blob/a13cb01b992a9fd74d1b6fd4e34c444bdf5a2d83/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java#L505

Plus fix returning same metadata on different resultsets: Doesn't make sense to cache NebulaResultSetMetaData into a static variable, because:

  1. NebulaResultSetMetaData object is light, it forwards calls to NebulaResultSet
  2. Hard to manage cached instance by the client, requires calling release() after usage
  3. Stacked ResultSets, getting metadata for second one will overwrite the first