Using Hibernate ORM in plugin

Hi!

I am writing plugin for Openfire and want to use Hibernate ORM inside.

Openfire has own connection pool to DB.

How i provide this connection pool to Hibernate?

So i need to make Hibernate use this pool.

Hibernate can make own connection pool but is it a good way to have additional pools?

After some investigation i found that i need to write custom connection provider for Hibernate and then in implementation call Openfire’s connection provider.