Attempting to retry query [message #904528] |
Tue, 28 August 2012 12:01  |
Eclipse User |
|
|
|
Hi,
I found a strange behaviour with EclipseLink as soon as I get a DatabaseException while I use a value which is too long for the database: The Exception is:
<28.08.2012 17:42 Uhr MESZ> <Notice> <EclipseLink> <BEA-2005000> <2012-08-28 17:42:43.886--UnitOfWork(32101512)--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.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.ibm.db2.jcc.am.co: DB2 SQL Error: SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER=3.57.82
Error Code: -302
The funny thing is, that EclipseLink try to retry the query but always reports the same error, this happens around 7 times until it returns the control to the program. The side effect is that this spends a lot of time (~10s).
The code looks like this:
Query _query = aEm.createNamedQuery("findCodeSystemWert");
_query.setParameter("systemNr", getSystemNr());
_query.setParameter("sprache", getSprachCode);
_query.setParameter("codeWert1Int", getCodeWert1Int());
_query.setParameter("codeWert1An", getCodeWert1An()); // value is more than CHAR(10)
_query.setParameter("datum", getSuchDatum());
//Here happens the retry automatically!!!
CodeWert1 _result = (CodeWert1)_query.getSingleResult();
The Code runs within a Stateless Session Bean on Weblogic Server and uses the following persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence>
<persistence-unit name="service.codesystem" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>db2_txds</jta-data-source>
<class>CodeSystem</class>
<class>CodeSystemDefinition</class>
<class>CodeWert1</class>
<class>CodeWert2</class>
<class>CodeWert3</class>
<class>CodeWert4</class>
<shared-cache-mode>NONE</shared-cache-mode>
</persistence-unit>
</persistence>
How I can change the behaviour, so that EclipseLink does not make any retry?
best regards,
Igor
Attachment: log.txt
(Size: 7.28KB, Downloaded 647 times)
[Updated on: Tue, 28 August 2012 12:01] by Moderator
|
|
|
|
Re: Attempting to retry query [message #905304 is a reply to message #904999] |
Thu, 30 August 2012 02:04  |
Eclipse User |
|
|
|
Hi James,
thank you for your answer.
My JPA is running whithin Weblogic Server 10.3.5. JPA gets the connection from the Connection Pool handled by Weblogic Server. In the Weblogic Server configuration I do have a SQL Statement for checking the database.
I used eclipselink.logging.level=FINEST but I can not see any ping SQL.
So what I found is to use a SessionCustomizer like this:
login.setConnectionHealthValidatedOnError(false);
Like this I get rid of the retry and anyway a potential error is reported.
best regards,
Igor
|
|
|
Powered by
FUDForum. Page generated in 0.05614 seconds