Concurrent queries on this JDBC connection?

I see that OraclePreparedStatement executeQuery () demonstrates serialization. That is, I have two queries that I want to run simultaneously with the Oracle database using the same connection. However, OraclePreparedStatement explicitly prohibits concurrent requests.

My question is: Is this serialization a necessary artifact to run both queries on the same connection, or is this configuration?

I tried to set readOnly to true for the duration of the two requests, but they are still being serialized.

+4
source share
1 answer

I believe that the methods of the Oracle Connection class are synchronized. see api description. Then it will be an artifact of using the same connection, not a custom property. If you need to get around this limitation, you can either use 2 connections or look at pooling if you want a more flexible solution.

+4
source

All Articles