Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Set a custom DataSource for the JPA EntityManagerFactory
PostPosted: Fri Oct 06, 2017 12:25 pm 
Newbie

Joined: Fri Oct 06, 2017 12:21 pm
Posts: 2
I have a project in which a datasource programmatically created in a standard JVM, must be used for the connection pool and I cannot create and keep and entitymangerFactory so I'd like to set the entitymanagerFactory's connection pool. But I do not know how to stop the EMF from creating its own pool and make it use the datasource provided pool.


Top
 Profile  
 
 Post subject: Re: Set the Connection pool of an EntityManager
PostPosted: Fri Oct 06, 2017 1:42 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1422
Easy peasy!

Fork my High-Performance Java Persistence GitHub repository and check out this test case.

You can configure the DataSource as you want and just pass it via the hibernate.connection.datasource configuration property.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
 Post subject: Re: Set a custom DataSource for the JPA EntityManagerFactory
PostPosted: Fri Oct 06, 2017 2:01 pm 
Newbie

Joined: Fri Oct 06, 2017 12:21 pm
Posts: 2
should this work I heart you


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.