Skip to content
Permalink
Browse files

Massive rework of the code base:

    - Base the actual lowel driver on one single callback. So that other languages / runtimes can plug in their own future / async mechanism. Avoiding to having ADBCJ futures being dispatched to Some-Other-Future
    - Move to Java 8:
        - Use Java 8's completable future, drop the ADBCJ home brew future
        - Java 8 future is not hard wired, but uses low level callbacks only.
    - Dropping cancellation feature: Due to pipe lining didn't do much most of the time.
    - Dropped connection pool as is. Extremely complex to implement this way. Will provide alternative connection pool in the future.
    - More cleanups and simplifications on the way.
  • Loading branch information...
gamlerhart committed Feb 28, 2017
1 parent d8debe9 commit 53f75a0b3b2e135fb43ae5bd86b0a25635dd6ade
Showing with 3,384 additions and 5,116 deletions.
  1. +9 −3 Readme.md
  2. +0 −3 adbcj-demo/src/main/java/info/adbcj/demo/Failure.java
  3. +1 −3 adbcj-demo/src/main/java/info/adbcj/demo/MainDemo.java
  4. +1 −3 adbcj-demo/src/main/java/info/adbcj/demo/PoolConfig.java
  5. +1 −5 api/src/main/java/org/adbcj/AbstractResultHandler.java
  6. +168 −14 api/src/main/java/org/adbcj/Connection.java
  7. +85 −33 api/src/main/java/org/adbcj/ConnectionManager.java
  8. +45 −41 api/src/main/java/org/adbcj/ConnectionManagerProvider.java
  9. +24 −0 api/src/main/java/org/adbcj/DbCallback.java
  10. +22 −0 api/src/main/java/org/adbcj/DbConnectionClosedException.java
  11. +46 −11 api/src/main/java/org/adbcj/DbException.java
  12. +0 −114 api/src/main/java/org/adbcj/DbFuture.java
  13. +0 −24 api/src/main/java/org/adbcj/DbListener.java
  14. +0 −96 api/src/main/java/org/adbcj/DbSession.java
  15. +0 −19 api/src/main/java/org/adbcj/DbSessionClosedException.java
  16. +0 −28 api/src/main/java/org/adbcj/DbSessionProvider.java
  17. +0 −11 api/src/main/java/org/adbcj/FutureState.java
  18. +27 −4 api/src/main/java/org/adbcj/PreparedQuery.java
  19. +11 −2 api/src/main/java/org/adbcj/PreparedStatement.java
  20. +11 −17 api/src/main/java/org/adbcj/PreparedUpdate.java
  21. +0 −7 api/src/main/java/org/adbcj/ResultHandler.java
  22. +0 −1 api/src/main/java/org/adbcj/StandardProperties.java
  23. +1 −2 api/src/main/java/org/adbcj/Type.java
  24. +61 −29 api/src/main/java/org/adbcj/support/AbstractConnectionManager.java
  25. +0 −8 api/src/main/java/org/adbcj/support/CancellationAction.java
  26. +0 −47 api/src/main/java/org/adbcj/support/CancellationToken.java
  27. +51 −0 api/src/main/java/org/adbcj/support/CloseOnce.java
  28. +38 −30 api/src/main/java/org/adbcj/{ → support}/ConnectionManagerFactory.java
  29. +29 −0 api/src/main/java/org/adbcj/support/DbCompletableFuture.java
  30. +0 −355 api/src/main/java/org/adbcj/support/DefaultDbFuture.java
  31. +10 −13 api/src/main/java/org/adbcj/support/DefaultResultEventsHandler.java
  32. +0 −47 api/src/main/java/org/adbcj/support/FutureUtils.java
  33. +0 −99 api/src/main/java/org/adbcj/support/SafeResultHandlerDecorator.java
  34. +0 −11 api/src/main/java/org/adbcj/support/stacktracing/MarkEntryPointToAdbcjException.java
  35. +0 −41 api/src/main/java/org/adbcj/support/stacktracing/StackTraceCapturing.java
  36. +15 −7 api/src/main/java/org/adbcj/support/stacktracing/StackTracingOptions.java
  37. +5 −5 api/src/test/java/org/adbcj/CheckConstructionManager.java
  38. +3 −3 api/src/test/java/org/adbcj/CheckConstructionMock.java
  39. +1 −3 api/src/test/java/org/adbcj/PassesStandardPropertiesTest.java
  40. +0 −246 api/src/test/java/org/adbcj/TestDefaultFuture.java
  41. +2 −2 api/src/test/java/org/adbcj/support/stacktracing/StackTraceCapturingTest.java
  42. 0 ...TA-INF/services/{org.adbcj.ConnectionManagerFactory → org.adbcj.support.ConnectionManagerFactory}
  43. +0 −12 api/todo.txt
  44. +1 −5 dbcj/src/main/java/org/adbcj/dbcj/Connection.java
  45. +0 −5 dbcj/src/main/java/org/adbcj/dbcj/ConnectionImpl.java
  46. +0 −2 dbcj/src/main/java/org/adbcj/dbcj/PreparedStatement.java
  47. +0 −4 dbcj/src/test/java/org/adbcj/dbcj/UtilTest.java
  48. +15 −17 h2/src/main/java/org/adbcj/h2/AbstractStatement.java
  49. +1 −3 h2/src/main/java/org/adbcj/h2/DateTimeUtils.java
  50. +6 −18 h2/src/main/java/org/adbcj/h2/Encoder.java
  51. +100 −150 h2/src/main/java/org/adbcj/h2/H2Connection.java
  52. +52 −92 h2/src/main/java/org/adbcj/h2/H2ConnectionManager.java
  53. +1 −4 h2/src/main/java/org/adbcj/h2/H2ConnectionManagerFactory.java
  54. +28 −7 h2/src/main/java/org/adbcj/h2/H2DbException.java
  55. +14 −23 h2/src/main/java/org/adbcj/h2/H2PreparedQuery.java
  56. +6 −8 h2/src/main/java/org/adbcj/h2/H2PreparedUpdate.java
  57. +1 −3 h2/src/main/java/org/adbcj/h2/H2Result.java
  58. +1 −3 h2/src/main/java/org/adbcj/h2/Handler.java
  59. +13 −151 h2/src/main/java/org/adbcj/h2/MathUtils.java
  60. +68 −40 h2/src/main/java/org/adbcj/h2/Request.java
  61. +195 −144 h2/src/main/java/org/adbcj/h2/RequestCreator.java
  62. +1 −3 h2/src/main/java/org/adbcj/h2/StringUtils.java
  63. +3 −2 h2/src/main/java/org/adbcj/h2/decoding/AnswerNextRequest.java
  64. +6 −6 h2/src/main/java/org/adbcj/h2/decoding/AwaitOk.java
  65. +7 −8 h2/src/main/java/org/adbcj/h2/decoding/CloseConnection.java
  66. +7 −10 h2/src/main/java/org/adbcj/h2/decoding/ClosedConnectionState.java
  67. +49 −47 h2/src/main/java/org/adbcj/h2/decoding/ColumnDecoder.java
  68. +8 −9 h2/src/main/java/org/adbcj/h2/decoding/CompleteTransaction.java
  69. +9 −10 h2/src/main/java/org/adbcj/h2/decoding/Decoder.java
  70. +3 −5 h2/src/main/java/org/adbcj/h2/decoding/DecoderState.java
  71. +16 −16 h2/src/main/java/org/adbcj/h2/decoding/FirstServerHandshake.java
  72. +1 −5 h2/src/main/java/org/adbcj/h2/decoding/H2Types.java
  73. +1 −3 h2/src/main/java/org/adbcj/h2/decoding/IoUtils.java
  74. +1 −3 h2/src/main/java/org/adbcj/h2/decoding/ParameterInfo.java
  75. +28 −18 h2/src/main/java/org/adbcj/h2/decoding/QueryHeader.java
  76. +60 −40 h2/src/main/java/org/adbcj/h2/decoding/RowDecoder.java
  77. +26 −19 h2/src/main/java/org/adbcj/h2/decoding/StatementPrepare.java
  78. +12 −5 h2/src/main/java/org/adbcj/h2/decoding/StatusReadingDecoder.java
  79. +24 −41 h2/src/main/java/org/adbcj/h2/decoding/UpdateResult.java
  80. +2 −5 h2/src/main/java/org/adbcj/h2/packets/AnnounceClientSession.java
  81. +3 −6 h2/src/main/java/org/adbcj/h2/packets/AutoCommitChangeCommand.java
  82. +2 −5 h2/src/main/java/org/adbcj/h2/packets/ClientHandshake.java
  83. +3 −20 h2/src/main/java/org/adbcj/h2/packets/ClientToServerPacket.java
  84. +2 −5 h2/src/main/java/org/adbcj/h2/packets/CloseCommand.java
  85. +7 −10 h2/src/main/java/org/adbcj/h2/packets/CommandClose.java
  86. +4 −8 h2/src/main/java/org/adbcj/h2/packets/CompoundCommand.java
  87. +1 −3 h2/src/main/java/org/adbcj/h2/packets/ParametersSerialisation.java
  88. +5 −9 h2/src/main/java/org/adbcj/h2/packets/QueryExecute.java
  89. +2 −3 h2/src/main/java/org/adbcj/h2/packets/QueryPrepareCommand.java
  90. +1 −3 h2/src/main/java/org/adbcj/h2/packets/SizeConstants.java
  91. +6 −8 h2/src/main/java/org/adbcj/h2/packets/UpdateExecute.java
  92. +2 −4 h2/src/main/java/org/adbcj/h2/protocol/CommandCodes.java
  93. +6 −8 h2/src/main/java/org/adbcj/h2/protocol/ReadUtils.java
  94. 0 ...TA-INF/services/{org.adbcj.ConnectionManagerFactory → org.adbcj.support.ConnectionManagerFactory}
  95. +0 −586 jdbc/src/main/java/org/adbcj/jdbc/AbstractDbSession.java
  96. +0 −14 jdbc/src/main/java/org/adbcj/jdbc/ActiveRequestIncomplete.java
  97. +1 −4 jdbc/src/main/java/org/adbcj/jdbc/JDBCConnectionProvider.java
  98. +57 −97 jdbc/src/main/java/org/adbcj/jdbc/JDBCPreparedStatement.java
  99. +10 −7 jdbc/src/main/java/org/adbcj/jdbc/JDBCResult.java
  100. +181 −256 jdbc/src/main/java/org/adbcj/jdbc/JdbcConnection.java
  101. +61 −89 jdbc/src/main/java/org/adbcj/jdbc/JdbcConnectionManager.java
  102. +2 −2 jdbc/src/main/java/org/adbcj/jdbc/JdbcConnectionManagerFactory.java
  103. +0 −7 jdbc/src/main/java/org/adbcj/jdbc/PlainJDBCConnection.java
  104. +6 −7 jdbc/src/main/java/org/adbcj/jdbc/ResultSetCopier.java
  105. +1 −4 jdbc/src/main/java/org/adbcj/jdbc/connectionpools/BoneCPConnection.java
  106. 0 ...TA-INF/services/{org.adbcj.ConnectionManagerFactory → org.adbcj.support.ConnectionManagerFactory}
  107. +3 −1 mysql-docker-run.sh
  108. +250 −0 mysql/src/main/java/org/adbcj/mysql/MySqlConnection.java
  109. +51 −53 mysql/src/main/java/org/adbcj/mysql/{netty → }/MySqlConnectionManagerFactory.java
  110. +82 −0 mysql/src/main/java/org/adbcj/mysql/MySqlPreparedStatement.java
  111. +223 −0 mysql/src/main/java/org/adbcj/mysql/MysqlConnectionManager.java
  112. +1 −34 mysql/src/main/java/org/adbcj/mysql/codec/ClientRequest.java
  113. +10 −31 mysql/src/main/java/org/adbcj/mysql/codec/MySqlClientEncoder.java
  114. +0 −258 mysql/src/main/java/org/adbcj/mysql/codec/MySqlConnection.java
  115. +0 −69 mysql/src/main/java/org/adbcj/mysql/codec/MySqlPreparedStatement.java
  116. +10 −22 mysql/src/main/java/org/adbcj/mysql/codec/MySqlRequest.java
  117. +105 −62 mysql/src/main/java/org/adbcj/mysql/codec/MySqlRequests.java
  118. +7 −7 mysql/src/main/java/org/adbcj/mysql/codec/MysqlException.java
  119. +1 −4 mysql/src/main/java/org/adbcj/mysql/codec/MysqlResult.java
  120. +8 −0 mysql/src/main/java/org/adbcj/mysql/codec/OKResponseType.java
  121. +2 −2 mysql/src/main/java/org/adbcj/mysql/codec/PasswordEncryption.java
  122. +3 −5 mysql/src/main/java/org/adbcj/mysql/codec/decoding/AcceptNextResponse.java
  123. +12 −10 mysql/src/main/java/org/adbcj/mysql/codec/decoding/Connecting.java
  124. +1 −4 mysql/src/main/java/org/adbcj/mysql/codec/decoding/DecoderState.java
  125. +11 −10 mysql/src/main/java/org/adbcj/mysql/codec/decoding/ExpectOK.java
  126. +21 −19 mysql/src/main/java/org/adbcj/mysql/codec/decoding/ExpectPreparQuery.java
  127. +33 −21 mysql/src/main/java/org/adbcj/mysql/codec/decoding/ExpectQueryResult.java
  128. +13 −13 mysql/src/main/java/org/adbcj/mysql/codec/decoding/ExpectStatementResult.java
  129. +27 −23 mysql/src/main/java/org/adbcj/mysql/codec/decoding/ExpectUpdateResult.java
  130. +47 −31 mysql/src/main/java/org/adbcj/mysql/codec/decoding/FieldDecodingState.java
  131. +35 −17 mysql/src/main/java/org/adbcj/mysql/codec/decoding/FieldEof.java
  132. +12 −12 mysql/src/main/java/org/adbcj/mysql/codec/decoding/FinishLogin.java
  133. +45 −43 mysql/src/main/java/org/adbcj/mysql/codec/decoding/FinishPrepareStatement.java
  134. +2 −5 mysql/src/main/java/org/adbcj/mysql/codec/decoding/ResponseStart.java
  135. +42 −29 mysql/src/main/java/org/adbcj/mysql/codec/decoding/Row.java
  136. +1 −4 mysql/src/main/java/org/adbcj/mysql/codec/packets/ClosePreparedStatementRequest.java
  137. +3 −26 mysql/src/main/java/org/adbcj/mysql/codec/packets/CommandRequest.java
  138. +2 −2 mysql/src/main/java/org/adbcj/mysql/codec/packets/ErrorResponse.java
  139. +1 −2 mysql/src/main/java/org/adbcj/mysql/codec/packets/LoginRequest.java
  140. +1 −4 mysql/src/main/java/org/adbcj/mysql/codec/packets/PreparedStatementRequest.java
  141. +1 −4 mysql/src/main/java/org/adbcj/mysql/codec/packets/PreparedStatementToBuild.java
  142. +0 −4 mysql/src/main/java/org/adbcj/mysql/codec/packets/StatementPreparedEOF.java
  143. +5 −10 mysql/src/main/java/org/adbcj/mysql/codec/packets/StringCommandRequest.java
  144. +0 −266 mysql/src/main/java/org/adbcj/mysql/netty/MysqlConnectionManager.java
  145. +0 −11 mysql/src/main/java/org/adbcj/mysql/netty/OKResponseType.java
  146. +0 −1 mysql/src/main/resources/META-INF/services/org.adbcj.ConnectionManagerFactory
  147. +1 −0 mysql/src/main/resources/META-INF/services/org.adbcj.support.ConnectionManagerFactory
  148. +14 −5 mysql/src/test/java/org/adbcj/mysql/codec/GreetingDecodeTest.java
  149. +48 −46 mysql/src/test/java/org/adbcj/mysql/codec/OkResponseDecodeTest.java
  150. +0 −1 tck/src/test/java/org/adbcj/tck/InitDatabase.java
  151. +1 −3 tck/src/test/java/org/adbcj/tck/InitMysql.java
  152. +0 −47 tck/src/test/java/org/adbcj/tck/TestUtils.java
  153. +8 −8 tck/src/test/java/org/adbcj/tck/test/AbstractWithConnectionManagerTest.java
  154. +15 −8 tck/src/test/java/org/adbcj/tck/test/CancelingRequests.java
  155. +23 −28 tck/src/test/java/org/adbcj/tck/test/CloseConnectionsTest.java
  156. +11 −9 tck/src/test/java/org/adbcj/tck/test/ConnectSpecialCaseTest.java
  157. +52 −53 tck/src/test/java/org/adbcj/tck/test/ConnectTest.java
  158. +6 −2 tck/src/test/java/org/adbcj/tck/test/ConnectionErrorsTest.java
  159. +62 −96 tck/src/test/java/org/adbcj/tck/test/ConnectionReusingTest.java
  160. +8 −8 tck/src/test/java/org/adbcj/tck/test/FailingOperationsTest.java
  161. +1 −4 tck/src/test/java/org/adbcj/tck/test/InsertTest.java
  162. +5 −6 tck/src/test/java/org/adbcj/tck/test/OverloadProtectionTests.java
  163. +66 −58 tck/src/test/java/org/adbcj/tck/test/PreparedStatementsTest.java
  164. +3 −5 tck/src/test/java/org/adbcj/tck/test/PreparedUpdateTest.java
  165. +28 −21 tck/src/test/java/org/adbcj/tck/test/SelectForUpdateTest.java
  166. +153 −66 tck/src/test/java/org/adbcj/tck/test/SelectTest.java
  167. +0 −4 tck/src/test/java/org/adbcj/tck/test/SupportedDataTypesTest.java
  168. +1 −1 tck/src/test/java/org/adbcj/tck/test/TransactionTest.java
  169. +1 −4 tck/src/test/java/org/adbcj/tck/test/UnicodeTest.java
  170. +1 −1 tck/src/test/java/org/adbcj/tck/test/UpdateTest.java
  171. +9 −15 tck/src/test/java/org/adbcj/tck/test/VoidIsVoidTest.java
@@ -1,9 +1,15 @@
# Asynchronous Database Connectivity in Java (ADBCJ)
ADBCJ allows you to access a relational database in a asynchronous, non-blocking fashion. The API is inspired by JDBC, but makes all calls asynchronous.
ADBCJ allows you to access a relational database in a asynchronous, non-blocking fashion.
The API is inspired by JDBC, but makes all calls asynchronous.

The asynchronous access prevents any blocked threads, which just wait for the result of the database. It also allows to pipeline operations, which are independent. Depending on the application, this can give a significat performance gain.
The asynchronous access prevents any blocked threads,
which just wait for the result of the database.

ADBCJ is intended as low level foundation. The language limitations of Java make it hard to dealy with fine grained, asynchronous operations. We recommend to use language and decorator library which makes the API fit for the specific task. Like for Scala:
It also allows to pipeline operations, which are independent.
Depending on the application, this can give a significant performance gain.

ADBCJ is intended as low level foundation.
Therefore it's is written in Java, so other languages like Scala, Groovy, Kotlin etc can cosume it to

## Documentation:
I'm working on it: https://github.com/gamlerhart/adbcj/wiki
@@ -5,9 +5,6 @@
import java.util.HashMap;
import java.util.Map;

/**
* @author roman.stoffel@gamlor.info
*/
public class Failure {
public static void main(String[] args) {

@@ -3,9 +3,7 @@
import org.adbcj.*;


/**
* @author roman.stoffel@gamlor.info
*/

public class MainDemo {

public static void main(String[] args) {
@@ -6,9 +6,7 @@
import java.util.HashMap;
import java.util.Map;

/**
* @author roman.stoffel@gamlor.info
*/

public class PoolConfig {
public static void main(String[] args) {
Map<String,String> config = new HashMap<String,String>();
@@ -1,7 +1,7 @@
package org.adbcj;

/**
* A empty implementation of the {@link ResultHandler} interface to avoid
* An empty implementation of the {@link ResultHandler} interface to avoid
* implementing each and every method.
*/
public abstract class AbstractResultHandler<T> implements ResultHandler<T> {
@@ -36,8 +36,4 @@ public void endRow(T accumulator) {
@Override
public void endResults(T accumulator) {
}

@Override
public void exception(Throwable t, T accumulator) {
}
}
@@ -16,24 +16,178 @@
*/
package org.adbcj;

import org.adbcj.support.DbCompletableFuture;
import org.adbcj.support.DefaultResultEventsHandler;
import org.adbcj.support.DefaultResultSet;

import java.util.concurrent.CompletableFuture;

/**
* A connection to a specific database. <code>Connection</code> objects are obtained using
* {@link ConnectionManager#connect()}.
* Connection to the database.
*
* Remember to close a connection after using it with {@link #close()}
* You get a connection via a {@see ConnectionManager}. Like so:
* <pre>
* ConnectionManager connections = ConnectionManagerProvider.createConnectionManager("adbcj:db-specific/url", "user", "password");
* Connection connection = connections.connect();
*
* @author Mike Heath
* @see DbSession
* @see ConnectionManager
* // Then use the connection
* </pre>
*/
public interface Connection extends DbSession {
public interface Connection {
/**
* Begin's a transaction using the default transaction isolation level.
* <p>
* The transaction is started immediately and all subsequent operations are executed
* in a transaction, until {@link #commit()} or {@link #rollback()} is called. This call
* also doesn't block: The communication to establish the transaction are executed in the background
* before the next call on the connection object.
*/
default CompletableFuture<Void> beginTransaction() {
DbCompletableFuture<Void> future = new DbCompletableFuture<>();
beginTransaction(future);
return future;
}

/**
* Same as {@link #beginTransaction()}. The callback is called when confirmation arrived for the transaction begin.
* However, right after calling this method, other commands can be sends and will be part of the transactions
*/
void beginTransaction(DbCallback<Void> callback);


default CompletableFuture<Void> commit() {
DbCompletableFuture<Void> future = new DbCompletableFuture<>();
commit(future);
return future;
}

/**
* Commits this transaction.
* Callback will complete if the transaction has been committed successfully,
* or contain the error when the commit failed.
* <p>
* After calling commit, the connection is again in auto-commit mode.
*/
void commit(DbCallback<Void> callback);


default CompletableFuture<Void> rollback() {
DbCompletableFuture<Void> future = new DbCompletableFuture<>();
rollback(future);
return future;
}


/**
* Commits this transaction.
* The callback completes when the transaction has been rolled back successfully.
* Rollbacks should not fail, however it it does the future will contain the error.
* <p>
* Rolling back a transaction might cancel all requests which have been made for this transaction.
* <p>
* After calling rollback, the connection is again in auto-commit mode.
*/
void rollback(DbCallback<Void> callback);

/**
* Indicates whether or not the current session is involved in a transaction.
*
* @return true if the session is in a transaction, false otherwise
*/
boolean isInTransaction();


default CompletableFuture<ResultSet> executeQuery(String sql) {
DefaultResultEventsHandler handler = new DefaultResultEventsHandler();
DefaultResultSet accumulator = new DefaultResultSet();
DbCompletableFuture<DefaultResultSet> result = new DbCompletableFuture<>();
executeQuery(sql, handler, accumulator, result);
return (DbCompletableFuture) result;
}



default <T> CompletableFuture<T> executeQuery(
String sql,
ResultHandler<T> eventHandler,
T accumulator) {
DbCompletableFuture<T> result = new DbCompletableFuture<>();
executeQuery(sql, eventHandler, accumulator, result);
return result;
}

<T> void executeQuery(String sql,
ResultHandler<T> eventHandler,
T accumulator,
DbCallback<T> callback);

default CompletableFuture<Result> executeUpdate(String sql) {
DbCompletableFuture<Result> future = new DbCompletableFuture<>();
executeUpdate(sql, future);
return future;
}

void executeUpdate(String sql, DbCallback<Result> callback);

default CompletableFuture<PreparedQuery> prepareQuery(String sql) {
DbCompletableFuture<PreparedQuery> future = new DbCompletableFuture<>();
prepareQuery(sql, future);
return future;
}

void prepareQuery(String sql, DbCallback<PreparedQuery> callback);

default CompletableFuture<PreparedUpdate> prepareUpdate(String sql) {
DbCompletableFuture<PreparedUpdate> future = new DbCompletableFuture<>();
prepareUpdate(sql, future);
return future;

}

void prepareUpdate(String sql, DbCallback<PreparedUpdate> callback);


/**
* {@link #close(CloseMode)} with {@link CloseMode#CLOSE_GRACEFULLY}
*/
default CompletableFuture<Void> close() {
return close(CloseMode.CLOSE_GRACEFULLY);
}

/**
* Closes this connection releases its resources.
* <p>
* This will close the connection gracefully {@link CloseMode#CLOSE_GRACEFULLY}. Running operations
* will finish before the manager is closed. However no new requests will be accepted
*
* @return a future object that will complete when the connection has closed
* @throws DbException if there's an error closing all the database connections
*/
default CompletableFuture<Void> close(CloseMode closeMod) {
DbCompletableFuture<Void> future = new DbCompletableFuture<>();
close(closeMod, future);
return future;
}

/**
* Closes this connection releases its resources.
* <p>
* This will close the according to the given {@link CloseMode}.
*
* @throws DbException if there's an error closing all the database connections
*/
void close(CloseMode closeMode, DbCallback<Void> callback);

boolean isClosed();

/**
* Returns the instance of the connection manager that created this connection.
*
* @return The connection manager instance that created this connection.
*/
ConnectionManager getConnectionManager();
default boolean isOpen() {
return !isClosed();
}


/**
* Returns the instance of the connection manager that created this connection.
*
* @return The connection manager instance that created this connection.
*/
ConnectionManager getConnectionManager();
}
Oops, something went wrong.

0 comments on commit 53f75a0

Please sign in to comment.
You can’t perform that action at this time.