Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump h2 from 2.1.214 to 2.2.220 in /demo #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>cc.carm.lib</groupId>
<groupId>com.ghostchu.fork.cc.carm.lib</groupId>
<artifactId>easysql-parent</artifactId>
<version>0.4.4</version>
</parent>
Expand Down
7 changes: 7 additions & 0 deletions api/src/main/java/cc/carm/lib/easysql/api/SQLManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ default void setDebugMode(boolean enable) {
*/
@NotNull Map<UUID, SQLQuery> getActiveQuery();

/**
* 得到计划的查询。
*
* @return 已计划的查询
*/
@NotNull Map<UUID, SQLAction<?>> getPendingQuery();

/**
* 获取改管理器提供的默认异常处理器。
* 若未使用过 {@link #setExceptionHandler(SQLExceptionHandler)} 方法,
Expand Down
4 changes: 2 additions & 2 deletions demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<groupId>com.ghostchu.fork.cc.carm.lib</groupId>
<version>0.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -76,7 +76,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.214</version>
<version>2.2.220</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<groupId>com.ghostchu.fork.cc.carm.lib</groupId>
<version>0.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ protected void debugMessage(List<Object[]> params) {
@Override
@SuppressWarnings("FutureReturnValueIgnored")
public void executeAsync(SQLHandler<T> success, SQLExceptionHandler failure) {
getManager().getPendingQuery().put(getActionUUID(),this);
getManager().getExecutorPool().submit(() -> {
try {
T returnedValue = execute();
getManager().getPendingQuery().remove(getActionUUID());
if (success != null) success.accept(returnedValue);
} catch (SQLException e) {
getManager().getPendingQuery().remove(getActionUUID());
handleException(failure, e);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import cc.carm.lib.easysql.action.PreparedSQLUpdateActionImpl;
import cc.carm.lib.easysql.action.SQLUpdateActionImpl;
import cc.carm.lib.easysql.action.SQLUpdateBatchActionImpl;
import cc.carm.lib.easysql.api.SQLAction;
import cc.carm.lib.easysql.api.SQLManager;
import cc.carm.lib.easysql.api.SQLQuery;
import cc.carm.lib.easysql.api.action.PreparedSQLUpdateAction;
Expand Down Expand Up @@ -32,6 +33,7 @@ public class SQLManagerImpl implements SQLManager {
private final Logger LOGGER;
private final DataSource dataSource;
private final ConcurrentHashMap<UUID, SQLQuery> activeQuery = new ConcurrentHashMap<>();
private final ConcurrentHashMap<UUID, SQLAction<?>> pendingQuery = new ConcurrentHashMap<>();
protected ExecutorService executorPool;
@NotNull Supplier<Boolean> debugMode = () -> Boolean.FALSE;

Expand Down Expand Up @@ -112,6 +114,11 @@ public void setExecutorPool(@NotNull ExecutorService executorPool) {
return this.activeQuery;
}

@Override
public @NotNull Map<UUID, SQLAction<?>> getPendingQuery() {
return this.pendingQuery;
}

@Override
public @NotNull SQLExceptionHandler getExceptionHandler() {
return this.exceptionHandler;
Expand Down
83 changes: 10 additions & 73 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

<groupId>cc.carm.lib</groupId>
<groupId>com.ghostchu.fork.cc.carm.lib</groupId>
<artifactId>easysql-parent</artifactId>
<packaging>pom</packaging>
<version>0.4.4</version>
Expand Down Expand Up @@ -96,12 +96,14 @@
</repositories>

<distributionManagement>
<downloadUrl>https://github.com/CarmJos/EasySQL/releases</downloadUrl>
<site>
<id>easysql-javadoc</id>
<name>EasySQL JavaDoc (on Github Pages)</name>
<url>https://CarmJos.github.io/EasySQL</url>
</site>
<repository>
<id>codemc-releases</id>
<url>https://repo.codemc.io/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>

<dependencies>
Expand Down Expand Up @@ -130,26 +132,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down Expand Up @@ -180,7 +162,7 @@

<includeDependencySources>true</includeDependencySources>
<dependencySourceIncludes>
<dependencySourceInclude>cc.carm.lib:*</dependencySourceInclude>
<dependencySourceInclude>com.ghostchu.fork.cc.carm.lib:*</dependencySourceInclude>
</dependencySourceIncludes>
</configuration>
<executions>
Expand Down Expand Up @@ -273,49 +255,4 @@
</resources>

</build>

<profiles>

<profile>
<id>ossrh</id>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>

<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>

<profile>
<id>github</id>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/CarmJos/EasySQL</url>
</repository>
</distributionManagement>
</profile>

<profile>
<id>local</id>
<distributionManagement>
<snapshotRepository>
<id>localRepository</id>
<url>file:${user.home}/local-deploy/</url>
</snapshotRepository>
<repository>
<id>localRepository</id>
<url>file:${user.home}/local-deploy/</url>
</repository>
</distributionManagement>
</profile>

</profiles>

</project>
2 changes: 1 addition & 1 deletion with-pool/beecp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<groupId>com.ghostchu.fork.cc.carm.lib</groupId>
<version>0.4.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion with-pool/hikaricp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<groupId>com.ghostchu.fork.cc.carm.lib</groupId>
<version>0.4.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down