1
Hello! I have two Webs applications that are connected to a single database in the bank, how do I make them enjoy the same connection pool? I create the c3p0 variables in the persistence.xml of both, or just one? Thanks!
1
Hello! I have two Webs applications that are connected to a single database in the bank, how do I make them enjoy the same connection pool? I create the c3p0 variables in the persistence.xml of both, or just one? Thanks!
2
As far as I know, this is not possible. Each application has its own separate connection pool. I don’t know solutions that seek to share connections pools between different applications.
What you could do is create a third application that is responsible for accessing the database and make the other two applications (or as many others) access it via REST+HTTP+JSON, or via XML+SOAP, via socket, via RMI, or anything like that. That is, the idea would be to encapsulate all access to the database in a webservice that holds exclusive access to the connection pool.
Browser other questions tagged java java-ee jpa jpa-2.0 c3p0
You are not signed in. Login or sign up in order to post.
I think it goes with JNDI... but I wouldn’t recommend
– Jefferson Quesado
Okay, thanks for your attention!
– user140439
I agree with Victor, I don’t know if it makes sense for you to share the pool on your own, maybe what’s more coherent is sharing cache through a distributed cache, but this is more about performance (queries and access to the bank), not sharing connections pool.
– nullptr