-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
Bug Report
Versions
- Driver:
- Database:
- Java:
- OS:
Current Behavior
Always Warn: H2Connection:294 - Option{name='readOnly', sensitive=false} + isn't supported in H2 at the transaction level. You must set it on conenction URL. See http://www.h2database.com/html/features.html#read_only
// your stack trace here
Table schema
Input Code
io.r2dbc.h2.H2Connection
@OverRide
public Mono beginTransaction(TransactionDefinition definition) {
return useTransactionStatus(inTransaction -> {
if (!inTransaction) {
IsolationLevel isolationLevel = definition.getAttribute(TransactionDefinition.ISOLATION_LEVEL);
Boolean readOnly = definition.getAttribute(TransactionDefinition.READ_ONLY);
Mono<Void> startTransaction = Mono.fromRunnable(() -> this.client.disableAutoCommit());
if (isolationLevel != null) {
startTransaction = startTransaction.then(setTransactionIsolationLevel(isolationLevel));
}
// THIS: only readOnly == true then warn
if (readOnly != null && readOnly) {
logger.warn(TransactionDefinition.READ_ONLY + " + isn't supported in H2 at the transaction level. " +
"You must set it on conenction URL. See http://www.h2database.com/html/features.html#read_only");
}
return startTransaction;
} else {
this.logger.debug("Skipping begin transaction because already in one");
return Mono.empty();
}
}).onErrorMap(DbException.class, H2DatabaseExceptionFactory::convert);
}
Metadata
Metadata
Assignees
Labels
No labels