Try upgrading to the latest version of UniObjects for Java in UniDK 5.2.1. I'm guessing that using UniJava may have exhibited that behavior in an older version. As long as you're just running BASIC programs, I'm guessing you will not run into any compatibility issues with 10.1.21:
- Visit https://rbc.rocketsoftware.com/u2bcesdinternal.asp?pid=100000047043&product=U2CL and download the U2 Current Clients installer
OR (for the long way)
- Visit https://rbc.rocketsoftware.com/buildmatrix.asp
- Select U2 Clients for the product and Windows for the platform
- Use the Product link in the Downloads column to download the installer
Honestly, I am using UniObjects for Java (in UniDK 5.2.1) to connect to Universe from a Spring Boot app, and I am able to create and maintain multiple parallel connections using similar code to you. If I get ten simultaneous web requests, I can see ten independent uvcs/defcs connections in Universe. The only thing I am doing differently is using the latest jars and I'm just creating a new instance of UniSession (and then later calling connect, like you) with:
UniSession uniSession = new UniSession();
instead of
UniSession uniSession = uniJava.openSession();
However, UniJava in the latest version seems to do basically the same thing as creating a new instance, but with some additional logging and tracking.
I did have someone at Rocket tell me at some point that the normal Universe license agreement forbids connection pool recreations, thus forcing you to purchase a connection pool licenses. I don't have the license handy to confirm. However, I cannot recommend purchasing connection pool licenses either without meeting with Rocket to talk specifics about your app requirements as it scales. Depending on load, durability, and performance requirements, you may need to spread read operations over multiple Universe replications, which isn't supported well/cost effectively by the published connection pool licensing model.