mirror of
https://gitee.com/dromara/Raincat.git
synced 2024-12-02 11:58:44 +08:00
资源文件去除
This commit is contained in:
parent
a9f649c2db
commit
24a475ad8a
@ -205,15 +205,6 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
|
||||
|
@ -45,4 +45,77 @@ public class TxDbConfig {
|
||||
*/
|
||||
private String password;
|
||||
|
||||
|
||||
/**
|
||||
* 初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
|
||||
*/
|
||||
private int initialSize = 10;
|
||||
|
||||
|
||||
/**
|
||||
* 最大连接池数量
|
||||
*/
|
||||
private int maxActive = 100;
|
||||
|
||||
/**
|
||||
* 最小连接池数量
|
||||
*/
|
||||
private int minIdle = 20;
|
||||
|
||||
|
||||
/**
|
||||
* 配置获取连接等待超时的时间
|
||||
*/
|
||||
private int maxWait = 60000;
|
||||
|
||||
|
||||
/**
|
||||
* 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
*/
|
||||
private int timeBetweenEvictionRunsMillis = 60000;
|
||||
|
||||
|
||||
/**
|
||||
* 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
*/
|
||||
private int minEvictableIdleTimeMillis = 300000;
|
||||
|
||||
|
||||
private String validationQuery = " SELECT 1 ";
|
||||
|
||||
|
||||
/**
|
||||
* 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
|
||||
*/
|
||||
private Boolean testOnBorrow = false;
|
||||
|
||||
|
||||
/**
|
||||
* 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
|
||||
*/
|
||||
private Boolean testOnReturn = false;
|
||||
|
||||
|
||||
/**
|
||||
* 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,
|
||||
* 如果空闲时间大于timeBetweenEvictionRunsMillis,
|
||||
* 执行validationQuery检测连接是否有效
|
||||
*/
|
||||
private Boolean testWhileIdle = true;
|
||||
|
||||
|
||||
/**
|
||||
* 是否缓存preparedStatement,也就是PSCache。
|
||||
* PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭
|
||||
*/
|
||||
private Boolean poolPreparedStatements=false;
|
||||
|
||||
|
||||
/**
|
||||
* 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true。
|
||||
* 在Druid中,
|
||||
* 不会存在Oracle下PSCache占用内存过多的问题,可以把这个数值配置大一些,比如说100
|
||||
*/
|
||||
private int maxPoolPreparedStatementPerConnectionSize=100;
|
||||
|
||||
}
|
||||
|
@ -24,22 +24,22 @@ package com.happylifeplat.transaction.common.enums;
|
||||
public enum CompensationActionEnum {
|
||||
|
||||
/**
|
||||
* Save compensation action enum.
|
||||
* Save compensate action enum.
|
||||
*/
|
||||
SAVE(0,"保存"),
|
||||
|
||||
/**
|
||||
* Delete compensation action enum.
|
||||
* Delete compensate action enum.
|
||||
*/
|
||||
DELETE(1,"删除"),
|
||||
|
||||
/**
|
||||
* Update compensation action enum.
|
||||
* Update compensate action enum.
|
||||
*/
|
||||
UPDATE(2,"更新"),
|
||||
|
||||
/**
|
||||
* Compensate compensation action enum.
|
||||
* Compensate compensate action enum.
|
||||
*/
|
||||
COMPENSATE(3,"补偿"),
|
||||
|
||||
|
@ -27,27 +27,27 @@ import java.util.Optional;
|
||||
public enum CompensationCacheTypeEnum {
|
||||
|
||||
/**
|
||||
* Db compensation cache type enum.
|
||||
* Db compensate cache type enum.
|
||||
*/
|
||||
DB("db"),
|
||||
|
||||
/**
|
||||
* File compensation cache type enum.
|
||||
* File compensate cache type enum.
|
||||
*/
|
||||
FILE("file"),
|
||||
|
||||
/**
|
||||
* Redis compensation cache type enum.
|
||||
* Redis compensate cache type enum.
|
||||
*/
|
||||
REDIS("redis"),
|
||||
|
||||
/**
|
||||
* Mongodb compensation cache type enum.
|
||||
* Mongodb compensate cache type enum.
|
||||
*/
|
||||
MONGODB("mongodb"),
|
||||
|
||||
/**
|
||||
* Zookeeper compensation cache type enum.
|
||||
* Zookeeper compensate cache type enum.
|
||||
*/
|
||||
ZOOKEEPER("zookeeper");
|
||||
|
||||
@ -58,10 +58,10 @@ public enum CompensationCacheTypeEnum {
|
||||
}
|
||||
|
||||
/**
|
||||
* Acquire compensation cache type compensation cache type enum.
|
||||
* Acquire compensate cache type compensate cache type enum.
|
||||
*
|
||||
* @param compensationCacheType the compensation cache type
|
||||
* @return the compensation cache type enum
|
||||
* @param compensationCacheType the compensate cache type
|
||||
* @return the compensate cache type enum
|
||||
*/
|
||||
public static CompensationCacheTypeEnum acquireCompensationCacheType(String compensationCacheType) {
|
||||
Optional<CompensationCacheTypeEnum> serializeProtocolEnum =
|
||||
@ -72,18 +72,18 @@ public enum CompensationCacheTypeEnum {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets compensation cache type.
|
||||
* Gets compensate cache type.
|
||||
*
|
||||
* @return the compensation cache type
|
||||
* @return the compensate cache type
|
||||
*/
|
||||
public String getCompensationCacheType() {
|
||||
return compensationCacheType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets compensation cache type.
|
||||
* Sets compensate cache type.
|
||||
*
|
||||
* @param compensationCacheType the compensation cache type
|
||||
* @param compensationCacheType the compensate cache type
|
||||
*/
|
||||
public void setCompensationCacheType(String compensationCacheType) {
|
||||
this.compensationCacheType = compensationCacheType;
|
||||
|
@ -119,13 +119,5 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
@ -202,14 +202,20 @@ public class JdbcTransactionRecoverRepository implements TransactionRecoverRepos
|
||||
dataSource.setDriverClassName(txDbConfig.getDriverClassName());
|
||||
dataSource.setUsername(txDbConfig.getUsername());
|
||||
dataSource.setPassword(txDbConfig.getPassword());
|
||||
dataSource.setInitialSize(2);
|
||||
dataSource.setMaxActive(20);
|
||||
dataSource.setMinIdle(0);
|
||||
dataSource.setMaxWait(60000);
|
||||
dataSource.setValidationQuery("SELECT 1");
|
||||
dataSource.setTestOnBorrow(false);
|
||||
dataSource.setTestWhileIdle(true);
|
||||
dataSource.setPoolPreparedStatements(false);
|
||||
|
||||
|
||||
dataSource.setInitialSize(txDbConfig.getInitialSize());
|
||||
dataSource.setMaxActive(txDbConfig.getMaxActive());
|
||||
dataSource.setMinIdle(txDbConfig.getMinIdle());
|
||||
dataSource.setMaxWait(txDbConfig.getMaxWait());
|
||||
dataSource.setValidationQuery(txDbConfig.getValidationQuery());
|
||||
dataSource.setTestOnBorrow(txDbConfig.getTestOnBorrow());
|
||||
dataSource.setTestOnReturn(txDbConfig.getTestOnReturn());
|
||||
dataSource.setTestWhileIdle(txDbConfig.getTestWhileIdle());
|
||||
dataSource.setPoolPreparedStatements(txDbConfig.getPoolPreparedStatements());
|
||||
dataSource.setMaxPoolPreparedStatementPerConnectionSize(txDbConfig.getMaxPoolPreparedStatementPerConnectionSize());
|
||||
|
||||
|
||||
this.tableName = RepositoryPathUtils.buildDbTableName(modelName);
|
||||
executeUpdate(SqlHelper.buildCreateTableSql(tableName, txDbConfig.getDriverClassName()));
|
||||
}
|
||||
|
@ -130,15 +130,6 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user