Re: How to change transaction level for metadata (INFORMATION_SCHEMA) operations (Spanner DB)?


Only you can decide what is "right" for your database, but requiring a CONNECTION "read only" (presumably this database has a JDBC driver and require a call of Connection.setReadOnly?) and changing the isolation level to NONE aren't the same thing! NONE will simply "auto-commit" the value generation connection.

The DN codebase doesn't currently have an explicit support for read-only connections (since no other database requires it) ... the only current use of "read-only" is where the whole database is "read only" allowing no changes. In the context of value generation, it gets a connection to get the current value generation "value" and optionally to write the new "value" (depending on the "strategy" used) using that single connection. It would require code changes to have a separate connection for any schema checks (in the value generation code) and a separate (read-write) connection for any value generation updates. Further to that, if you pass a connection through to the schema handling code for "value generation" and it finds that the "table" required doesn't exist, then it would need to create it ... and if the connection is read-only then it won't work! Think through what you really want to do

Join { to automatically receive all group messages.