Disable Shared Memory in JDBC Driver URL
Hey guys! I'm working on a Java application that connects to Iris via JDBC. I need to disable SharedMemory via connection URL. I would like to know how I can check if the parameter was turned on or off within Iris when connecting to Java. Thanks for your help!
One way to do that is to use your server's LAN IP in the JDBC URL instead of using 127.0.0.1 or localhost, if that suits your needs.
You can cast the Connection to IRISConnection.isUsingSharedMemory() to see if the current connection is connected via shared memory.
You can disable it when getting a connection by passing a Property = SharedMemory=false
You can also disable it on a DataSource with setSharedMemory(false)
I'm curious why would you need it, are there any issues when working via shared memory?
As already mentioned, you have some options, use a different host, or use DriverParameters
For instance, in DBeaver it may look like this, if there is no SharedMemory option visible, you still can add it manually
I'm not sure what Matheus' specific issue was, but I had to do this when using SAP's Crystal Reports Java API because when shared memory was enabled, it tended to leave connections hanging open when it shouldn't, and eventually the number of connections would exceed the maximum. With shared memory disabled, it worked as expected.