When using an embedded database, such as H2 or hsqldb, you often can not access the database from more then one connection at a time.
For instance, expanding the server in the Servers list and then right clicking and attempting to open a Query Analyzer on a table results in an error.
Or the opposite, having a Query Analyzer open and connected to the database and then attempting to expand the server in the Server list results in an error.
Or, having the server expanded in the Server list OR having a Query Analyzer open and then modifying the Server Properties and then saving attempts to verify the connection and produces an error.
Or attempting to open multiple Query Analyzers fails.
I tried enabling "Connections Pooled" in the Server Properties under the Advanced tab but that doesn't seem to resolve any of the above issues.
Reading the documentation here: https://www.aquaclusters.com/app/home/project/public/aquadatastudio/wikibook/Documentation15/page/Connection-Pooling/Connection-Pooling, it clearly states that multiple connections would still be used by the different components.
|
38 KB
|
37 KB
|
85 KB
This behavior has to do with the implementation of the JDBC driver of the database (such as H2). There is nothing that Aqua Data Studio can do about the drivers file locking mechanism. Server based databases provide concurrency through semaphores which allow multi-use, while some embedded databases just use file locking. The only way an embedded database would allow concurrency is if they used semaphores to synchronize access to the same file. This is possible within one JVM, but it would be up to the driver to implement this. If the driver limits one connection per database, then the driver is imposing the limit. I don't believe that Apache Derby has this limit on their Embedded Database.
Also note that the H2 driver error is suggesting to run in Server Mode.
I understand the issue along with what the driver is doing-- what I'm asking for is that Data Studio provide some type of option in Server Properties to indicate this Server is restricted to a single connection and if set, maybe to share the connection between components such as the Server/Schema browser and Query Analyzers (obviously understanding that there would be restrictions such as possibly not being able to execute queries in two Query Analyzers, etc)-- or if it can't be shared, to at least complain that isn't a single connection server?
I also realize that H2 is suggesting running in Server Mode but the benefits of being able to quickly "spin up a database" directly within Data Studio for rapid prototyping, or ad-hoc data processing and analytics is what I'm attempting to do. I do realize that H2 has their "automatic mixed mode" but addressing this inside of Data Studio itself provides the ability to use other embedded database such as Hsqldb in addition to the concern that the first connection, when closed, may bring down other connections.
Thanks you for the consideration!
I understand the issue along with what the driver is doing-- what I'm asking for is that Data Studio provide some type of option in Server Properties to indicate this Server is restricted to a single connection and if set, maybe to share the connection between components such as the Server/Schema browser and Query Analyzers (obviously understanding that there would be restrictions such as possibly not being able to execute queries in two Query Analyzers, etc)-- or if it can't be shared, to at least complain that isn't a single connection server?
I also realize that H2 is suggesting running in Server Mode but the benefits of being able to quickly "spin up a database" directly within Data Studio for rapid prototyping, or ad-hoc data processing and analytics is what I'm attempting to do. I do realize that H2 has their "automatic mixed mode" but addressing this inside of Data Studio itself provides the ability to use other embedded database such as Hsqldb in addition to the concern that the first connection, when closed, may bring down other connections.
Thanks you for the consideration!
Issue #13155 |
Closed |
Invalid |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
This behavior has to do with the implementation of the JDBC driver of the database (such as H2). There is nothing that Aqua Data Studio can do about the drivers file locking mechanism. Server based databases provide concurrency through semaphores which allow multi-use, while some embedded databases just use file locking. The only way an embedded database would allow concurrency is if they used semaphores to synchronize access to the same file. This is possible within one JVM, but it would be up to the driver to implement this. If the driver limits one connection per database, then the driver is imposing the limit. I don't believe that Apache Derby has this limit on their Embedded Database.
Also note that the H2 driver error is suggesting to run in Server Mode.