| pool: 1 connection [message #974736] |
Wed, 07 November 2012 04:31  |
Tom Eugelink Messages: 801 Registered: July 2009 |
Senior Member |
|
|
I'm using Eclipselink inside a Swing client, this means that connection pooling has a lesser performance advantage, however unnecessary connections have a big RDBMS license impact.
Is it possible to configure EL to only use one connection? I now have this setup:
lOptions.put(PersistenceUnitProperties.JOIN_EXISTING_TRANSACTION, "true"); // reads and write should go through the same connection, otherwise batchtransfer will have connection conflicts
lOptions.put(PersistenceUnitProperties.JDBC_SEQUENCE_CONNECTION_POOL , "true"); // this is deprecated, but the replacement CONNECTION_POOL_SEQUENCE does not work on 3.1.2-M1 // force sequences to use a separate pool, so rollback do not undo counter increments
lOptions.put(PersistenceUnitProperties.CONNECTION_POOL_INITIAL, "1"); // for the RDBMS licenses
lOptions.put(PersistenceUnitProperties.CONNECTION_POOL_MAX, "1"); // for the RDSBMS licenses
This results in two connections when I ask the RDBMS, I suspect one for data and one for the sequence?
If I set it up like this (replace JDBC_SEQUENCE_CONNECTION_POOL).
lOptions.put(PersistenceUnitProperties.JOIN_EXISTING_TRANSACTION, "true"); // reads and write should go through the same connection, otherwise batchtransfer will have connection conflicts
lOptions.put(PersistenceUnitProperties.CONNECTION_POOL_SEQUENCE , "true"); // force sequences to use a separate pool, so rollback do not undo counter increments
lOptions.put(PersistenceUnitProperties.CONNECTION_POOL_INITIAL, "1"); // for the RDBMS licenses
lOptions.put(PersistenceUnitProperties.CONNECTION_POOL_MAX, "1"); // for the RDSBMS licenses
There now only is one connection, but that scares me a bit, because not using the deprecated option should not change the behavior.
So:
1. Is there any way to see what a certain connection is intended for?
2. Is it possible to setup a pool with a single (or even 0) permanent connections, but still have the sequences done in a separate transaction (opening a separate connection if needed)?
Tom
|
|
|