I have implemented a connection pool to my database which is connected to 2 middlewares. Now the problem is that my school doesnt want us to used the jdbc provided functionalities to do this hence I have to think of another way. Basically we are using java and postgres.
I was thinking of the following as a substitute:
each middleware creates a 3 connections to the database each(hence 6 connections in total)
then I never close those connections until the application closes,hence each middleware can use the connections and leave them but not close them.
Would this be a connection pool? I was also thinking that I could make 1 middleware initialize a set of connections that stay alive until the end of the application,and each middleware can hold onto an active connection to the db. The problem is I have no idea how to go through with these ideas.
Would this be feasible? If so can I pass the connection handle between middlewares? This is a distributed application, so I am not sure how to go through with this.