Community
Participate
Working Groups
Build Identifier: When a connection to Informix database is broken Eclipselnik fails to recover: <pre> Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.0.v20100614-r7608): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Connection not established Error Code: -79730 Call: SELECT * FROM xx WHERE id=1 Query: ReadObjectQuery(referenceClass=SlovnikImpl sql="SELECT * FROM xx WHERE id=1") at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:683) ... </pre> Eclipselink supports reconnection in such situation for databases such as Oracle, SqlServer or MySql but not for Informix. Eclipselink supports the feature by means of a ping SQL query. It is possible to add such support for Informix also by adding foloving lines into InformixPlatform.java (package org.eclipse.persistence.platform.database): <code> public InformixPlatform() { super(); super.pingSQL = "select 1 from sysusers"; } </code> Tested versions : - Eclipselink: 2.1.0.v20100614-r7608 respective 2.2.0.v20110202-r8913; - IBM Informix JDBC Driver for IBM Informix Dynamic Server: 3.00.JC3 respective 3.50.JC6W1. Reproducible: Always Steps to Reproduce: 1. Create session and connect it to database. 2. Close the connection by DB server means (or by session.getAccessor().getConnection().close()). 3. Execute a query against database
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
An alternate statement might be. select count(*) from sysusers Reason: It will always only result in 1 row.
I suspect this "bug" will never get any attention, is you want to work around it I did the following and I did wonders for my application following a network outage recovery. 1) created a new Database Platform Class. package my.eclipselink; public class InformixSEPlatform extends org.eclipse.persistence.platform.database.InformixPlatform { private static final long serialVersionUID = 1L; public InformixSEPlatform() { super(); pingSQL = "SELECT COUNT(*) FROM SYSUSERS"; } } 2) Added the persistence.xml property to use it. <property name="eclipselink.target-database" value="my.eclipselink.InformixSEPlatform"/> PS. Thank you designers for the flexible design of eclipselink.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink