Subject Re: [Firebird-Java] HikariCP Connection Pool won't connect to Firebird DataSource
Author
Hi Mark,

Thanks for the prompt reply.  I subclassed the FBSimpleDataSource, added url property in my subclass along with a getter and a setter.  When I modified .properties I was still getting the complain about url.  As you pointed out in your reply it's because that properties() method over in application is looking to set url (not needed by FBSimpleDataSource).  So, I removed some property setters from that method and added what I knew would be needed by FBSimpleDataSource (database, dialect, charSet).  With those changes I think that the pool is now happy and appears to be connecting.  My latest complaint is now that the Spring bean factory is throwing a NoSuchBeanDefinition exception.  It's a little bit curious because I think that my Entity bean and Repository followed the annotaitons that were in the original sample.

Here's the stack trace I get now (think I'm making some progress - thanks!):
[INFO ] 2018-02-22 11:40:16.892 [main] AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@6e2c9341: startup date [Thu Feb 22 11:40:16 MST 2018]; root of context hierarchy
[INFO ] 2018-02-22 11:40:17.060 [main] AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[INFO ] 2018-02-22 11:40:17.285 [main] LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'com.hikariTest'
[INFO ] 2018-02-22 11:40:17.301 [main] LogHelper - HHH000204: Processing PersistenceUnitInfo [
name: com.hikariTest
...]
[INFO ] 2018-02-22 11:40:17.391 [main] Version - HHH000412: Hibernate Core {5.2.6.Final}
[INFO ] 2018-02-22 11:40:17.397 [main] Environment - HHH000206: hibernate.properties not found
[INFO ] 2018-02-22 11:40:17.433 [main] Version - HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
[INFO ] 2018-02-22 11:40:17.549 [main] ConnectionProviderInitiator - HHH000130: Instantiating explicit connection provider: org.hibernate.hikaricp.internal.HikariCPConnectionProvider
[INFO ] 2018-02-22 11:40:17.561 [main] HikariDataSource - HikariPool-1 - Started.
[INFO ] 2018-02-22 11:40:17.807 [main] PoolBase - HikariPool-1 - Driver does not support get/set network timeout for connections. (Not yet implemented.)
[INFO ] 2018-02-22 11:40:17.839 [main] Dialect - HHH000400: Using dialect: org.hibernate.dialect.FirebirdDialect
[INFO ] 2018-02-22 11:40:18.109 [main] LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'com.hikariTest'
[INFO ] 2018-02-22 11:40:18.127 [main] HikariDataSource - HikariPool-2 - Started.
[INFO ] 2018-02-22 11:40:18.148 [main] PoolBase - HikariPool-2 - Driver does not support get/set network timeout for connections. (Not yet implemented.)
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.repository.CSLogRepository' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:353)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:340)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)
at com.application.Application.main(Application.java:44)

Here's a summary of my current state:
application.properties:
...
spring.jpa.properties.hibernate.hikari.dataSourceClassName=org.firebirdsql.ds.FBSimpleDataSource
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.FirebirdDialect
spring.jpa.properties.hibernate.hikari.dataSource.database=//server:port/c:/path/dbFile.GDB
spring.jpa.properties.hibernate.hikari.dataSource.charSet=utf-8
spring.jpa.properties.hibernate.hikari.dataSource.roleName=USER
spring.jpa.properties.hibernate.hikari.dataSource.user=USERNAME
spring.jpa.properties.hibernate.hikari.dataSource.password=password
...

Mods to Application.properties():

Removed get/set on url.  Added get/set on charSet, dialect, database. Seems happier and thanks. 

I'm in the process of plowing through your suggestions right now.  Based on your responses I'm wondering if I chose a bad starting point for a proof of concept.  I have no need for the Liquibase logging and some of the other features in that sample.  All I'm really trying to do is develop a small Spring Data JPA app that uses a connection pool where I can change connection parameters so that I can set additional Firebird Connection parameters like transaction read committed and others.  I've been warned off of the default Hibernate connection pool by Vlad Mihalcea.  He also recommended that I contact you for help configuring a Java Connection Pool with Firebird.  Please give me a moment to apply the rest of your suggestions and I'll post back.  

Thanks for your help,
Bill