HikariCP + Aurora + mariadb jdbc driver

1,144 views
Skip to first unread message

Xing Du

unread,
May 20, 2017, 7:12:53 PM5/20/17
to HikariCP
Hi all,

I'm updating my jdbc driver according to aurora recommendation and I'm running into a weird issue. 
I'd like to ask if anyone has done such set up before and can help me explain what happened.

 - Before changes - 
HikariCP 2.6.1 + mysql jdbc driver 5.1.4 + aurora

 - After changes - 
HikariCP 2.6.1 + mariadb jdbc driver 2.0.1 + aurora

Issue:
all connections using mariadb jdbc driver stuck during creation.

Usage:
String driver = "org.mariadb.jdbc.Driver";
String jdbcUrl = "jdbc:mysql://aurora-cluster-end-point:3306";
Class.forName(driver);
HikariConfig  config = new HikariConfig();
config.setDriverClassName(driver);
config.setJdbcUrl(jdbcUrl);
config.setUsername(user);
config.setPassword(password);
config.setConnectionTimeout(30000);
config.setMaximumPoolSize(20);
config.setAutoCommit(false);
config.addDataSourceProperty("cachePrepStmts", true);
config.addDataSourceProperty("prepStmtCacheSize", 250);
config.addDataSourceProperty("prepStmtCacheSqlLimit", 2048);
datasource = new HikariDataSource(config);

For
 getting connection:
Connection c = datasource.getConnection();

Last log I see
thread="main" log="INFO" class="c.z.h.HikariDataSource" HikariPool-5 - Starting...

I was also told by Amazon Aurora team to use dbcp2 as the connection pooling lib but I prefer using HikariCP. 
I'd be grateful if anyone can explain to me why this happened and how possibly it can be fixed.

Much thanks in advance!


Xing Du

unread,
May 23, 2017, 5:34:23 PM5/23/17
to HikariCP
Update on this:
Looked at the source code for HikariCP and I don't think it was doing anything wrong.
I think this is an issue for mariadb driver when used together with aurora.

Xing Du

unread,
May 23, 2017, 7:54:15 PM5/23/17
to HikariCP
Confirmed this is an issue with MariaDB driver. More specifically, version 1.6.0 / 2.0.0 or above
1.5.9 works fine with this set up in case anyone is trying the same thing
Reply all
Reply to author
Forward
0 new messages