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


yunus@...
 

Thanks for the response. 
I noted that only 5.2 is open for merge.

After your comment, I've dug deep and I've seen that it is possible to request a new connection for value-generation with a different isolation level. I've set datanucleus.valuegeneration.transactionIsolation to none. Now I am able to run the tutorial sample.
Do you think that this is the correct solution?

The stack trace is below. In the highlighted RDBMSStoreManager.getStrategyValueForGenerator() a new connection is created. After I set the above valuegeneration.transactionIsolation to None, everything was fine.:

com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory$JdbcSqlExceptionImpl: INVALID_ARGUMENT: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Unsupported concurrency mode in query using INFORMATION_SCHEMA.
at com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory.of(JdbcSqlExceptionFactory.java:208)
at com.google.cloud.spanner.jdbc.AbstractJdbcStatement.executeQuery(AbstractJdbcStatement.java:166)
at com.google.cloud.spanner.jdbc.JdbcPreparedStatement.executeQueryWithOptions(JdbcPreparedStatement.java:62)
at com.google.cloud.spanner.jdbc.JdbcDatabaseMetaData.getTables(JdbcDatabaseMetaData.java:761)
at org.datanucleus.store.rdbms.datasource.dbcp.DelegatingDatabaseMetaData.getTables(DelegatingDatabaseMetaData.java:589)
at org.datanucleus.store.rdbms.schema.RDBMSSchemaHandler.getTableType(RDBMSSchemaHandler.java:433)
at org.datanucleus.store.rdbms.table.AbstractTable.exists(AbstractTable.java:588)
at org.datanucleus.store.rdbms.valuegenerator.TableGenerator.repositoryExists(TableGenerator.java:242)
at org.datanucleus.store.rdbms.valuegenerator.AbstractRDBMSGenerator.obtainGenerationBlock(AbstractRDBMSGenerator.java:81)
at org.datanucleus.store.valuegenerator.AbstractGenerator.obtainGenerationBlock(AbstractGenerator.java:184)
at org.datanucleus.store.valuegenerator.AbstractGenerator.next(AbstractGenerator.java:92)
at org.datanucleus.store.rdbms.RDBMSStoreManager.getStrategyValueForGenerator(RDBMSStoreManager.java:2048)
at org.datanucleus.store.AbstractStoreManager.getStrategyValue(AbstractStoreManager.java:1290)
at org.datanucleus.state.StateManagerImpl.populateStrategyFields(StateManagerImpl.java:2201)
at org.datanucleus.state.StateManagerImpl.initialiseForPersistentNew(StateManagerImpl.java:418)
at org.datanucleus.state.StateManagerImpl.initialiseForPersistentNew(StateManagerImpl.java:120)
at org.datanucleus.state.ObjectProviderFactoryImpl.newForPersistentNew(ObjectProviderFactoryImpl.java:218)
at org.datanucleus.ExecutionContextImpl.persistObjectInternal(ExecutionContextImpl.java:2079)
at org.datanucleus.ExecutionContextImpl.persistObjectInternal(ExecutionContextImpl.java:2177)
at org.datanucleus.store.types.SCOUtils.validateObjectForWriting(SCOUtils.java:1486)
at org.datanucleus.store.rdbms.scostore.ElementContainerStore.validateElementForWriting(ElementContainerStore.java:422)
at org.datanucleus.store.rdbms.scostore.JoinSetStore.addAll(JoinSetStore.java:341)
at org.datanucleus.store.rdbms.mapping.java.CollectionMapping.postInsert(CollectionMapping.java:157)
at org.datanucleus.store.rdbms.request.InsertRequest.execute(InsertRequest.java:522)
at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObjectInTable(RDBMSPersistenceHandler.java:162)
at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObject(RDBMSPersistenceHandler.java:138)
at org.datanucleus.state.StateManagerImpl.internalMakePersistent(StateManagerImpl.java:3363)
at org.datanucleus.state.StateManagerImpl.makePersistent(StateManagerImpl.java:3339)
at org.datanucleus.ExecutionContextImpl.persistObjectInternal(ExecutionContextImpl.java:2080)
at org.datanucleus.ExecutionContextImpl.persistObjectWork(ExecutionContextImpl.java:1923)
at org.datanucleus.ExecutionContextImpl.persistObject(ExecutionContextImpl.java:1778)
at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:724)
at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:749)
at org.datanucleus.samples.jdo.tutorial.Main.main(Main.java:61)

Join main@datanucleus.groups.io to automatically receive all group messages.