-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add support for hikari cp, upgrade c3p0 library, break static dependencies #126
Add support for hikari cp, upgrade c3p0 library, break static dependencies #126
Conversation
how can i activate the hikaricp pool in my quartz.properties? |
@stefanwendelmann If you are still looking for an answer, we recently switched quartz to use Hikaricp and do it as below (we use Spring for IoC) //Create the datasource @Bean(destroyMethod = "close")
@DependsOn("flyway")
public HikariDataSource hikariDataSource() {
HikariConfig config = new HikariConfig();
config.setJdbcUrl(env.getProperty("database.url", "jdbc_url....."));
config.setDriverClassName("driver class name...");
config.setUsername(env.getProperty("database.username", "username..."));
config.setPassword(env.getProperty("database.password", "password..."));
config.setMinimumIdle(env.getProperty("database.connectionPool.size.min", Integer.class, 5));
config.setMaximumPoolSize(env.getProperty("database.connectionPool.size.max", Integer.class, 10));
config.setMetricRegistry(metricRegistry);
config.setAutoCommit(false);
return new HikariDataSource(config);
} And then inject the datasource as below @Bean
@Profile(value = {"prod"})
public SchedulerFactoryBean schedulerFactoryBean(DataSource hikariDataSource,
PlatformTransactionManager transactionManager) {
SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
setSchedulerParameters(hikariDataSource, transactionManager, schedulerFactoryBean);
return schedulerFactoryBean;
} |
On Mon, Aug 21, 2017 at 8:48 AM, Stefan ***@***.***> wrote:
how can i activate the hikaricp pool in my quartz.properties?
Stefan, try adding the following:
org.quartz.dataSource.myDS.connectionProvider.class=org.quartz.utils.HikariCpPoolingConnectionProvider
If you need more example, see
org.quartz.utils.HikariCpPoolingConnectionProviderTest
…--Zemian
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#126 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVOkkDbPm17Bo6dyZGQ5Mv4SipCjdIxMks5saXykgaJpZM4M-X-l>
.
|
hi, @zemian , after adding
will cause a exception:
|
if only add |
My project already uses Hikari CP. When I upgraded Quartz from 2.2.2 to 2.3.0, it started breaking in strange ways. It was very difficult for me to track down the problem. It turns out that this is because Quartz now includes dependence on HikariCP-java6-2.3.13, but I want to be using the more recent, java8 version, HikariCP-2.7.2. I suppose I can add an "exclusion" when importing Quartz via Maven and then manually add my own version of Hikari. But will this break Quartz? |
For those who still have issues with HirakiCP, you can see #294 for solutions. |
Replaces #20
Add a connection provider for HikariCP
Update to latest C3p0
Break static dependecies on C3p0 so that it isn't required on the class path even if you're not using it
Also addresses minor concerns in #19