Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » [SOLVED] For each call a new connection? Need only one when using RCP with Gemini or Swing
[SOLVED] For each call a new connection? Need only one when using RCP with Gemini or Swing [message #1243812] Tue, 11 February 2014 13:27 Go to next message
Jack Kilian is currently offline Jack KilianFriend
Messages: 40
Registered: March 2012
Member
[EL Fine]: sql: 2014-02-11 14:19:32.238--ServerSession(32763213)--Connection(12471488)--Thread(Thread[main,6,main])-- SELECT ... FROM ... WHERE ...
bind => [138]
[EL Fine]: sql: 2014-02-11 14:19:32.261--ServerSession(32763213)--Connection(21809008)--Thread(Thread[main,6,main])-- SELECT ... FROM ... WHERE ...
[EL Fine]: sql: 2014-02-11 14:19:32.287--ServerSession(32763213)--Connection(14435067)--Thread(Thread[main,6,main])-- SELECT ... FROM ... WHERE ...
[EL Fine]: sql: 2014-02-11 14:19:32.31--ServerSession(32763213)--Connection(11986356)--Thread(Thread[main,6,main]) -- SELECT ... FROM ... WHERE ...
[EL Fine]: sql: 2014-02-11 14:19:32.336--ServerSession(32763213)--Connection(27439281)--Thread(Thread[main,6,main])-- SELECT ... FROM ... WHERE ...
[EL Info]: 2014-02-11 14:19:32.351--ServerSession(32763213)--Thread(Thread[main,6,main])--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130824-981335c): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
oracle:1234:XE

persistence.xml:
<properties>
<property name="eclipselink.jdbc.native-sql" value="false"/>
<property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@server:1234:XE"/>
<property name="javax.persistence.jdbc.user" value="user"/>
<property name="javax.persistence.jdbc.password" value="password"/>
<property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>

<property name="eclipselink.weaving" value="true"/>
<property name="eclipselink.weaving.internal" value="true"/>
<property name="eclipselink.logging.level" value="FINE" />
</properties>


For each call a new connection is opened. I think anytime the amount of maximum connections is fully reached, then an error is raised. How can I configure that in the case I use EclipseLink in RCP or Swing only one or two connections a used and not changed for each call.

[Updated on: Wed, 12 February 2014 06:54]

Report message to a moderator

Re: For each call a new connection? Need only one when using RCP with Gemini or Swing [message #1243982 is a reply to message #1243812] Tue, 11 February 2014 18:42 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
As per http://www.eclipse.org/eclipselink/documentation/2.4/concepts/data_access006.htm
EclipseLink will pool connections by default. Judging by the timestamp though, your application might not be done with the query before another connection is needed.

The settings for connection pools are configurable and somewhat described here:
http://eclipse.org/eclipselink/documentation/2.4/jpa/extensions/p_connection_pool.htm
You will want to set the max connection number to match what your server is configured to allow, and remember that there is both a read and write connection pool.
[SOLVED] For each call a new connection? Need only one when using RCP with Gemini JPA [message #1244320 is a reply to message #1243982] Wed, 12 February 2014 06:54 Go to previous message
Jack Kilian is currently offline Jack KilianFriend
Messages: 40
Registered: March 2012
Member
thx for your answer.

but the problem was deeper. i found a bug-report regarding Gemini JPA I use in my project. since eclipse link 2.5.1 there is a bugfix regarding my problem. when I use that property the connection is not changed for each db call.

see https://bugs.eclipse.org/bugs/show_bug.cgi?id=379397

<properties>
[...]
<property name="eclipselink.connection-pool.force-internal-pool" value="true"/>
[...]
</properties>




Previous Topic:Saving a referenced existing entity results in a new entity
Next Topic:MOXy XPath expression compatibility with DOM and javax.xml.xpath.XPath
Goto Forum:
  


Current Time: Fri Apr 26 22:41:42 GMT 2024

Powered by FUDForum. Page generated in 0.03270 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top