Replaced HikariCP with MariaDB built-in pool.
This commit is contained in:
@@ -5,10 +5,7 @@
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="dist/libs/HikariCP-3.4.5.jar" sourcepath="dist/libs/HikariCP-3.4.5-sources.jar"/>
|
||||
<classpathentry kind="lib" path="dist/libs/mariadb-java-client-2.6.1.jar" sourcepath="dist/libs/mariadb-java-client-2.6.1-sources.jar"/>
|
||||
<classpathentry kind="lib" path="dist/libs/slf4j-api-1.7.30.jar" sourcepath="dist/libs/slf4j-api-1.7.30-sources.jar"/>
|
||||
<classpathentry kind="lib" path="dist/libs/slf4j-simple-1.7.30.jar" sourcepath="dist/libs/slf4j-simple-1.7.30-sources.jar"/>
|
||||
<classpathentry including="**/*.java" kind="src" path="dist/game/data/scripts"/>
|
||||
<classpathentry kind="src" path="java"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
|
2
L2J_Mobius_C6_Interlude/dist/game/java.cfg
vendored
2
L2J_Mobius_C6_Interlude/dist/game/java.cfg
vendored
@@ -1 +1 @@
|
||||
-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=org.l2jmobius.log.ServerLogManager -Dorg.slf4j.simpleLogger.log.com.zaxxer.hikari=error -Xmx4g -Xms2g
|
||||
-server -Dfile.encoding=UTF-8 -Djava.util.logging.manager=org.l2jmobius.log.ServerLogManager -Xmx4g -Xms2g
|
Binary file not shown.
BIN
L2J_Mobius_C6_Interlude/dist/libs/HikariCP-3.4.5.jar
vendored
BIN
L2J_Mobius_C6_Interlude/dist/libs/HikariCP-3.4.5.jar
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -19,33 +19,26 @@ package org.l2jmobius.commons.database;
|
||||
import java.sql.Connection;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import org.mariadb.jdbc.MariaDbPoolDataSource;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @version November 10th 2018
|
||||
*/
|
||||
public class DatabaseFactory
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(DatabaseFactory.class.getName());
|
||||
|
||||
private static final HikariDataSource _hds = new HikariDataSource();
|
||||
private static final MariaDbPoolDataSource DATABASE_POOL = new MariaDbPoolDataSource(Config.DATABASE_URL + "&user=" + Config.DATABASE_LOGIN + "&password=" + Config.DATABASE_PASSWORD + "&minPoolSize=" + Config.DATABASE_MAX_CONNECTIONS + "&maxPoolSize=" + Config.DATABASE_MAX_CONNECTIONS + "&maxIdleTime=60");
|
||||
|
||||
public static void init()
|
||||
{
|
||||
_hds.setDriverClassName(Config.DATABASE_DRIVER);
|
||||
_hds.setJdbcUrl(Config.DATABASE_URL);
|
||||
_hds.setUsername(Config.DATABASE_LOGIN);
|
||||
_hds.setPassword(Config.DATABASE_PASSWORD);
|
||||
_hds.setMaximumPoolSize(Config.DATABASE_MAX_CONNECTIONS);
|
||||
_hds.setConnectionTimeout(600000);
|
||||
_hds.setMaxLifetime(1200000);
|
||||
|
||||
// Test if connection is valid.
|
||||
try
|
||||
{
|
||||
_hds.getConnection().close();
|
||||
DATABASE_POOL.getConnection().close();
|
||||
LOGGER.info("Database: Initialized.");
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -61,7 +54,7 @@ public class DatabaseFactory
|
||||
{
|
||||
try
|
||||
{
|
||||
con = _hds.getConnection();
|
||||
con = DATABASE_POOL.getConnection();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -75,7 +68,7 @@ public class DatabaseFactory
|
||||
{
|
||||
try
|
||||
{
|
||||
_hds.close();
|
||||
DATABASE_POOL.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@@ -1,17 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.l2jmobius.gameserver.GameServer"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="L2J_Mobius_C6_Interlude"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.slf4j.simpleLogger.log.com.zaxxer.hikari=error"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:L2J_Mobius_C6_Interlude}/dist/game/"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.l2jmobius.gameserver.GameServer"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="L2J_Mobius_C6_Interlude"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="L2J_Mobius_C6_Interlude"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:L2J_Mobius_C6_Interlude}/dist/game/"/>
|
||||
</launchConfiguration>
|
||||
|
@@ -1,18 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.l2jmobius.loginserver.LoginServer"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="L2J_Mobius_C6_Interlude"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.slf4j.simpleLogger.log.com.zaxxer.hikari=error"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:L2J_Mobius_C6_Interlude}/dist/login/"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.l2jmobius.loginserver.LoginServer"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="L2J_Mobius_C6_Interlude"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="L2J_Mobius_C6_Interlude"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:L2J_Mobius_C6_Interlude}/dist/login/"/>
|
||||
</launchConfiguration>
|
||||
|
Reference in New Issue
Block a user