Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » pool: 1 connection
pool: 1 connection [message #974736] Wed, 07 November 2012 04:31 Go to previous message
Tom Eugelink is currently offline 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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Write List<Object> to file using Eclipselink Moxy
Next Topic:newbie: Native SQL Query
Goto Forum:
  


Current Time: Sat May 18 21:31:11 EDT 2013

Powered by FUDForum. Page generated in 0.01587 seconds