com.github.davidmoten.rx.jdbc.QueryContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxjava-jdbc Show documentation
Show all versions of rxjava-jdbc Show documentation
rx-java Observables for jdbc
package com.github.davidmoten.rx.jdbc;
import rx.Scheduler;
/**
* The threading and database connection context for mutliple jdbc queries.
*
*/
final class QueryContext {
private final Database db;
/**
* Constructor.
*
* @param executor
* @param connectionProvider
*/
QueryContext(Database db) {
this.db = db;
}
/**
* Returns the scheduler service to use to run queries with this context.
*
* @return
*/
Scheduler scheduler() {
return db.currentScheduler();
}
/**
* Returns the connection provider for queries with this context.
*
* @return
*/
ConnectionProvider connectionProvider() {
return db.connectionProvider();
}
void beginTransactionObserve() {
db.beginTransactionObserve();
}
void beginTransactionSubscribe() {
db.beginTransactionSubscribe();
}
void endTransactionSubscribe() {
db.endTransactionSubscribe();
}
void endTransactionObserve() {
db.endTransactionObserve();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy