public class ReadOnlyReconnectingDbConnection extends Object implements DbQueryable
Is thread-safe, you can use this from multiple threads
It is assumed that the results of one query are read before the next one begins. Starting a new query can close the old database connection when reconnecting, meaning reads from previous queries might not work.
DbTransaction,
Project on GitHub| Modifier and Type | Class and Description |
|---|---|
protected class |
ReadOnlyReconnectingDbConnection.ReconnectingDbQueryResultSet |
| Modifier and Type | Field and Description |
|---|---|
protected DbTransaction.DbTransactionFactory |
fac |
protected ThreadLocal<DbTransaction> |
tx |
| Constructor and Description |
|---|
ReadOnlyReconnectingDbConnection(DbTransaction.DbTransactionFactory fac) |
| Modifier and Type | Method and Description |
|---|---|
DbTransaction.DbQueryResultSet |
query(CharSequence sql,
List<?> args) |
DbTransaction.DbQueryResultSet |
query(String sql,
Object... args) |
protected DbTransaction.DbTransactionFactory fac
protected ThreadLocal<DbTransaction> tx
public ReadOnlyReconnectingDbConnection(DbTransaction.DbTransactionFactory fac)
public DbTransaction.DbQueryResultSet query(String sql, Object... args)
query in interface DbQueryablepublic DbTransaction.DbQueryResultSet query(CharSequence sql, List<?> args)
query in interface DbQueryableCopyright © 2003–2018. All rights reserved.