Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » pingsql
pingsql [message #730063] Tue, 27 September 2011 14:54 Go to next message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
I've picked up my years long running attempt again to get EclipseLink to validate a connection in a JavaSE enviroment. Currently I have two attempts in place:

1. SessionCustomizer:
session.getLogin().setPingSQL("select 1 from article where articlenr < 0");

2. Extend the InformixDatabasePlatform:
@Override public String getPingSQL()
{
return "select 2 from article where articlenr < 0";
}

Both attempts were correctly executed during app-startup, but the ping SQL statement was never.
After upgrading to Eclipselink 2.2.0 extending the database platform is no longer an option.

Why oh why is the ping SQL statement not executed?

Tom
Re: pingsql [message #730067 is a reply to message #730063] Tue, 27 September 2011 14:56 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
> After upgrading to Eclipselink 2.2.0 extending the database platform is no longer an option.

This is incorrect, I can still override the getPingSQL().
Re: pingsql [message #731973 is a reply to message #730067] Mon, 03 October 2011 15:16 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Note that the ping SQL is only executed when a connection errors occurs, not before every database access (as this would be very expensive).

When you attempt a query on a dead connection and error will occur, EclipseLink will catch the error, execute the ping SQL, if the connection is dead it will be reconnected, it will then re-execute the query if possible.


James : Wiki : Book : Blog : Twitter
Re: pingsql [message #731976 is a reply to message #730067] Mon, 03 October 2011 15:16 Go to previous messageGo to next message
James is currently offline James
Messages: 272
Registered: July 2009
Senior Member
Note that the ping SQL is only executed when a connection errors occurs, not before every database access (as this would be very expensive).

When you attempt a query on a dead connection and error will occur, EclipseLink will catch the error, execute the ping SQL, if the connection is dead it will be reconnected, it will then re-execute the query if possible.

--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Re: pingsql [message #732332 is a reply to message #731973] Tue, 04 October 2011 14:09 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
On 2011-10-03 17:16, James wrote:
> Note that the ping SQL is only executed when a connection errors occurs, not before every database access (as this would be very expensive).
>
> When you attempt a query on a dead connection and error will occur, EclipseLink will catch the error, execute the ping SQL, if the connection is dead it will be reconnected, it will then re-execute the query if possible.
>

Ok, minor test case:

...
Article lArticle1 = Article.findByPK(82);
System.out.println(lArticle1.createStringForDisplay());
System.out.println("------");

JOptionPane.showConfirmDialog(null, "waiting");

System.out.println("------");
Article lArticle2 = Article.findByPK(16000);
System.out.println(lArticle2.createStringForDisplay());
....

The find is a simple:
lEntityManager.find(nl.reinders.bm.Article.class, articlenr);

Naturally during the showConfirmDialog the database engine is shut down and started. Search for the two lines with "-------":

[EL Finest]: 2011-10-04 16:01:47.406--ServerSession(32112901)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.user; value=user
[EL Finest]: 2011-10-04 16:01:47.437--ServerSession(32112901)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.password; value=xxxxxx
[EL Finest]: 2011-10-04 16:01:48.108--ServerSession(32112901)--Thread(Thread[main,5,main])--property=eclipselink.target-database; value=nl.reinders.jdbc.InformixPlatform
[EL Finest]: 2011-10-04 16:01:48.108--ServerSession(32112901)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.driver; value=nl.reinders.jdbc.ReindersInformixAndLoggingDriver
[EL Finest]: 2011-10-04 16:01:48.108--ServerSession(32112901)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.url; value=jdbc:reinders:com.informix.jdbc.IfxDriver#jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8
[EL Finest]: 2011-10-04 16:01:48.108--ServerSession(32112901)--Thread(Thread[main,5,main])--property=eclipselink.jdbc.sequence-connection-pool; value=true
[EL Finest]: 2011-10-04 16:01:48.139--ServerSession(32112901)--Thread(Thread[main,5,main])--property=eclipselink.cache.shared.default; value=false
[EL Finest]: 2011-10-04 16:01:48.139--ServerSession(32112901)--Thread(Thread[main,5,main])--property=eclipselink.jdbc.native-sql; value=true
[EL Finest]: 2011-10-04 16:01:48.139--ServerSession(32112901)--Thread(Thread[main,5,main])--property=eclipselink.jdbc.cache-statements; value=true
[EL Finest]: 2011-10-04 16:01:48.139--ServerSession(32112901)--Thread(Thread[main,5,main])--property=eclipselink.allow-zero-id; value=true
[EL Finest]: 2011-10-04 16:01:48.139--ServerSession(32112901)--Thread(Thread[main,5,main])--property=eclipselink.session.customizer; value=nl.reinders.bm.support.SessionCustomizer
!!!3.50.JC3DE
!!!pingsql1=select first 1 1 from systables
!!!QueryRetryAttemptCount=3
!!!DelayBetweenConnectionAttempts=5000
[EL Info]: 2011-10-04 16:01:48.139--ServerSession(32112901)--Thread(Thread[main,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.0.0.v20091127-r5931
[EL Config]: 2011-10-04 16:01:48.139--ServerSession(32112901)--Connection(29321385)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
platform=>InformixPlatform
user name=> "user"
datasource URL=> "jdbc:reinders:com.informix.jdbc.IfxDriver#jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8"
))
[EL Config]: 2011-10-04 16:01:48.53--ServerSession(32112901)--Connection(12652000)--Thread(Thread[main,5,main])--Connected: jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8
User: user
Database: Informix Dynamic Server Version: 11.50.TC3
Driver: IBM Informix JDBC Driver for IBM Informix Dynamic Server Version: 3.50.JC3DE
[EL Config]: 2011-10-04 16:01:48.53--ServerSession(32112901)--Connection(7730615)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
platform=>InformixPlatform
user name=> "user"
datasource URL=> "jdbc:reinders:com.informix.jdbc.IfxDriver#jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8"
))
[EL Config]: 2011-10-04 16:01:48.576--ServerSession(32112901)--Connection(29441291)--Thread(Thread[main,5,main])--Connected: jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8
User: user
Database: Informix Dynamic Server Version: 11.50.TC3
Driver: IBM Informix JDBC Driver for IBM Informix Dynamic Server Version: 3.50.JC3DE
[EL Config]: 2011-10-04 16:01:48.592--ServerSession(32112901)--Connection(6367194)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
platform=>InformixPlatform
user name=> "user"
datasource URL=> "jdbc:reinders:com.informix.jdbc.IfxDriver#jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8"
))
[EL Config]: 2011-10-04 16:01:48.654--ServerSession(32112901)--Connection(33083511)--Thread(Thread[main,5,main])--Connected: jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8
User: user
Database: Informix Dynamic Server Version: 11.50.TC3
Driver: IBM Informix JDBC Driver for IBM Informix Dynamic Server Version: 3.50.JC3DE
[EL Finest]: 2011-10-04 16:01:48.654--ServerSession(32112901)--Thread(Thread[main,5,main])--sequencing connected, state is Preallocation_Transaction_Accessor_State
[EL Finest]: 2011-10-04 16:01:48.654--ServerSession(32112901)--Thread(Thread[main,5,main])--sequence contractpaymentnr: preallocation size 1
....
[EL Finer]: 2011-10-04 16:01:49.341--ServerSession(32112901)--Thread(Thread[main,5,main])--acquire unit of work: 31810172
2011-10-04 16:01:49,357 DEBUG nl.knowledgeplaza.util.jpa.EntityManagerExtender.invoke(EntityManagerExtender.java:298) #d320d6 setFlushMode(COMMIT)
2011-10-04 16:01:49,357 INFO nl.knowledgeplaza.util.jpa.EntityManagerFinder.setEntityManagerFinder(EntityManagerFinder.java:77) Registered an EntityManagerFinder: nl.knowledgeplaza.util.jpa.EntityManagerFinderSingleton@d98b00
2011-10-04 16:01:49,357 DEBUG nl.knowledgeplaza.util.jpa.EntityManagerExtender.invoke(EntityManagerExtender.java:298) #d320d6 find(class nl.reinders.bm.Employee, 1)
[EL Finer]: 2011-10-04 16:01:49.357--ServerSession(32112901)--Thread(Thread[main,5,main])--client acquired
[EL Finest]: 2011-10-04 16:01:49.591--UnitOfWork(1217874)--Thread(Thread[main,5,main])--Execute query ReadObjectQuery(referenceClass=Employee sql="SELECT employeenr, lazylock, dwhmodified, dwhby, name FROM employee WHERE (employeenr = ?)")
[EL Fine]: 2011-10-04 16:01:49.591--ServerSession(32112901)--Connection(29441291)--Thread(Thread[main,5,main])--SELECT employeenr, lazylock, dwhmodified, dwhby, name FROM employee WHERE (employeenr = ?)
bind => [1]
2011-10-04 16:01:49,997 DEBUG nl.knowledgeplaza.util.jpa.EntityManagerExtender.invoke(EntityManagerExtender.java:298) #d320d6 find(class nl.reinders.bm.Article, 82)
[EL Finest]: 2011-10-04 16:01:49.997--UnitOfWork(1217874)--Thread(Thread[main,5,main])--Execute query ReadObjectQuery(referenceClass=Article sql="SELECT articlenr, sale, opwebdate, weight, veer, sellingprice, seqnr, rolkop, webshopprice, keywords, width, artist, opweb, is_landscape, ean, f, c, info, dwhmodified, trashcan, last_supplier_relationnr, printcost_articletypenr, inserted, actueel, minimalstock_plano, articlecode, haslicenses, archive_location, managestock, std_reservation, articlepricegroupnr, tapper, rolinstellingenok, length, lazylock, opwebshop, is_ending, dwhby, description, minimalstock, articletypenr FROM article WHERE (articlenr = ?)")
[EL Fine]: 2011-10-04 16:01:49.997--ServerSession(32112901)--Connection(29441291)--Thread(Thread[main,5,main])--SELECT articlenr, sale, opwebdate, weight, veer, sellingprice, seqnr, rolkop, webshopprice, keywords, width, artist, opweb, is_landscape, ean, f, c, info, dwhmodified, trashcan, last_supplier_relationnr, printcost_articletypenr, inserted, actueel, minimalstock_plano, articlecode, haslicenses, archive_location, managestock, std_reservation, articlepricegroupnr, tapper, rolinstellingenok, length, lazylock, opwebshop, is_ending, dwhby, description, minimalstock, articletypenr FROM article WHERE (articlenr = ?)
bind => [82]
[EL Finest]: 2011-10-04 16:01:50.075--UnitOfWork(1217874)--Thread(Thread[main,5,main])--Execute query ReadObjectQuery(name="iLastSupplierRelation" referenceClass=Relation )
[EL Fine]: 2011-10-04 16:01:50.075--ServerSession(32112901)--Connection(29441291)--Thread(Thread[main,5,main])--SELECT relationnr, sellorder_state_20_allowed, isreinders, billprefix, delivery_addressnr, webshop_url, shortname, ritnr, relationid3, edifact_desadv_no_zero_amount, edifact_desadv_builder, tobepaidwithin, edifact_invoic_no_zero_amount, grootboeknr, edifact_desadv_builder_test, info, wholesale, dwhmodified, banknaam, use_pricerules, currencynr, incassobanknr, edifact_invoic_builder, incassodagen, btwnummer, name, rabatt, lazylock, relationnr2, allow_backorders, potential_customer, reinders_lieferantenkode, btwnr, report_countrycodenr, uses_pricegroups, external_sellorder_mandatory, incassoreknr, delivery_relationnr, reinders_relationnr, officeid, officegroupid, haspriceagreement, bill_info, retour, relationsegmentnr, payment_agreement, internalnr, agreement_info, belastingnr, allow_buyorder, edifact_invoic_no_credits, skonto, bez, allow_sellorder, external_sellorde
r_pattern,
ritnr2, istransport, skontodagen, externalnr, dwhby, edifact_invoic_builder_test, relationgroupnr FROM relation WHERE (relationnr = ?)
bind => [50081]
[EL Finest]: 2011-10-04 16:01:50.465--UnitOfWork(1217874)--Thread(Thread[main,5,main])--Register the existing object nl.reinders.bm.Relation@1cc15a&Relationnr=50081
[EL Finest]: 2011-10-04 16:01:50.481--UnitOfWork(1217874)--Thread(Thread[main,5,main])--Execute query ReadObjectQuery(name="iArticletype" referenceClass=Articletype )
[EL Fine]: 2011-10-04 16:01:50.481--ServerSession(32112901)--Connection(29441291)--Thread(Thread[main,5,main])--SELECT articletypenr, lazylock, grootboeknr, sizedescription, seqnr, dwhmodified, articletypegroupnr, dwhby, op_web, pricerulecode, description, template_article_xml, grootboeknr_offset, code FROM articletype WHERE (articletypenr = ?)
bind => [3]
[EL Finest]: 2011-10-04 16:01:50.606--UnitOfWork(1217874)--Thread(Thread[main,5,main])--Register the existing object nl.reinders.bm.Articletype@7b79&Articletypenr=3&pricecode=maxi
82 - Kurt Cobain - smoking w/ guitar [Maxi Poster]
------
------
2011-10-04 16:04:25,552 DEBUG nl.knowledgeplaza.util.jpa.EntityManagerExtender.invoke(EntityManagerExtender.java:298) #d320d6 find(class nl.reinders.bm.Article, 16000)
[EL Finest]: 2011-10-04 16:04:25.552--UnitOfWork(1217874)--Thread(Thread[main,5,main])--Execute query ReadObjectQuery(referenceClass=Article sql="SELECT articlenr, sale, opwebdate, weight, veer, sellingprice, seqnr, rolkop, webshopprice, keywords, width, artist, opweb, is_landscape, ean, f, c, info, dwhmodified, trashcan, last_supplier_relationnr, printcost_articletypenr, inserted, actueel, minimalstock_plano, articlecode, haslicenses, archive_location, managestock, std_reservation, articlepricegroupnr, tapper, rolinstellingenok, length, lazylock, opwebshop, is_ending, dwhby, description, minimalstock, articletypenr FROM article WHERE (articlenr = ?)")
[EL Fine]: 2011-10-04 16:04:25.583--ServerSession(32112901)--Connection(29441291)--Thread(Thread[main,5,main])--SELECT articlenr, sale, opwebdate, weight, veer, sellingprice, seqnr, rolkop, webshopprice, keywords, width, artist, opweb, is_landscape, ean, f, c, info, dwhmodified, trashcan, last_supplier_relationnr, printcost_articletypenr, inserted, actueel, minimalstock_plano, articlecode, haslicenses, archive_location, managestock, std_reservation, articlepricegroupnr, tapper, rolinstellingenok, length, lazylock, opwebshop, is_ending, dwhby, description, minimalstock, articletypenr FROM article WHERE (articlenr = ?)
bind => [16000]
2011-10-04 16:04:25,583 INFO nl.knowledgeplaza.util.jdbc.PreparedStatement.invoke(PreparedStatement.java:127) #24991702[C1171427]: executeQuery: java.lang.reflect.InvocationTargetException->java.sql.SQLException: System or internal error java.net.SocketException: Connection reset by peer: socket write error
2011-10-04 16:04:25,583 INFO nl.knowledgeplaza.util.jdbc.PreparedStatement.invoke(PreparedStatement.java:127) #24991702[C1171427]: close: java.lang.reflect.InvocationTargetException->java.sql.SQLException: System or internal error java.net.SocketException: Connection reset by peer: socket write error
[EL Warning]: 2011-10-04 16:04:25.583--UnitOfWork(1217874)--Thread(Thread[main,5,main])--Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: System or internal error java.net.SocketException: Connection reset by peer: socket write error
Error Code: -79716
Call: SELECT articlenr, sale, opwebdate, weight, veer, sellingprice, seqnr, rolkop, webshopprice, keywords, width, artist, opweb, is_landscape, ean, f, c, info, dwhmodified, trashcan, last_supplier_relationnr, printcost_articletypenr, inserted, actueel, minimalstock_plano, articlecode, haslicenses, archive_location, managestock, std_reservation, articlepricegroupnr, tapper, rolinstellingenok, length, lazylock, opwebshop, is_ending, dwhby, description, minimalstock, articletypenr FROM article WHERE (articlenr = ?)
bind => [16000]
Query: ReadObjectQuery(referenceClass=Article sql="SELECT articlenr, sale, opwebdate, weight, veer, sellingprice, seqnr, rolkop, webshopprice, keywords, width, artist, opweb, is_landscape, ean, f, c, info, dwhmodified, trashcan, last_supplier_relationnr, printcost_articletypenr, inserted, actueel, minimalstock_plano, articlecode, haslicenses, archive_location, managestock, std_reservation, articlepricegroupnr, tapper, rolinstellingenok, length, lazylock, opwebshop, is_ending, dwhby, description, minimalstock, articletypenr FROM article WHERE (articlenr = ?)")
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:686)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:529)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:529)
at org.eclipse.persistence.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:133)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:205)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:191)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectOneRow(DatasourceCallQueryMechanism.java:638)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRowFromTable(ExpressionQueryMechanism.java:2582)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRow(ExpressionQueryMechanism.java:2553)
at org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:431)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:997)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:675)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:958)
at org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:399)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1021)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2863)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1225)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1207)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1167)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.executeQuery(EntityManagerImpl.java:733)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.findInternal(EntityManagerImpl.java:677)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:581)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:460)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at nl.knowledgeplaza.util.jpa.EntityManagerExtender.invoke(EntityManagerExtender.java:384)
at $Proxy3.find(Unknown Source)
at nl.reinders.bm.generated.Article.findOptionallyLockByPK(Article.java:3404)
at nl.reinders.bm.generated.Article.findByPK(Article.java:3414)
at nl.reinders.bm.generated.Article.findByPK(Article.java:3439)
at nl.reinders.bm.BMTestToplink.main(BMTestToplink.java:856)
Caused by: java.sql.SQLException: System or internal error java.net.SocketException: Connection reset by peer: socket write error
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:482)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:9172)
at com.informix.jdbc.IfxSqli.flip(IfxSqli.java:2712)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2483)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:1746)
at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java:1698)
at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java:1629)
at com.informix.jdbc.IfxResultSet.a(IfxResultSet.java:206)
at com.informix.jdbc.IfxStatement.executeQueryImpl(IfxStatement.java:1228)
at com.informix.jdbc.IfxPreparedStatement.executeQuery(IfxPreparedStatement.java:376)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at nl.knowledgeplaza.util.jdbc.PreparedStatement.invoke(PreparedStatement.java:102)
at $Proxy4.executeQuery(Unknown Source)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:891)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:601)
... 32 more
Caused by: java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.informix.asf.IfxDataOutputStream.flush(IfxDataOutputStream.java:175)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:2732)
at com.informix.jdbc.IfxSqli.k(IfxSqli.java:2742)
at com.informix.jdbc.IfxSqli.flip(IfxSqli.java:2706)
... 47 more
Internal Exception: java.sql.SQLException: System or internal error java.net.SocketException: Connection reset by peer: socket write error
Error Code: -79716
Call: SELECT articlenr, sale, opwebdate, weight, veer, sellingprice, seqnr, rolkop, webshopprice, keywords, width, artist, opweb, is_landscape, ean, f, c, info, dwhmodified, trashcan, last_supplier_relationnr, printcost_articletypenr, inserted, actueel, minimalstock_plano, articlecode, haslicenses, archive_location, managestock, std_reservation, articlepricegroupnr, tapper, rolinstellingenok, length, lazylock, opwebshop, is_ending, dwhby, description, minimalstock, articletypenr FROM article WHERE (articlenr = ?)
bind => [16000]
Query: ReadObjectQuery(referenceClass=Article sql="SELECT articlenr, sale, opwebdate, weight, veer, sellingprice, seqnr, rolkop, webshopprice, keywords, width, artist, opweb, is_landscape, ean, f, c, info, dwhmodified, trashcan, last_supplier_relationnr, printcost_articletypenr, inserted, actueel, minimalstock_plano, articlecode, haslicenses, archive_location, managestock, std_reservation, articlepricegroupnr, tapper, rolinstellingenok, length, lazylock, opwebshop, is_ending, dwhby, description, minimalstock, articletypenr FROM article WHERE (articlenr = ?)")
2011-10-04 16:04:25,614 DEBUG nl.knowledgeplaza.util.jpa.EntityManagerExtender.invoke(EntityManagerExtender.java:298) #d320d6 close()
[EL Finer]: 2011-10-04 16:04:25.614--UnitOfWork(1217874)--Thread(Thread[main,5,main])--release unit of work
[EL Finer]: 2011-10-04 16:04:25.614--ClientSession(21726381)--Thread(Thread[main,5,main])--client released
[EL Finest]: 2011-10-04 16:04:25.614--ServerSession(32112901)--Thread(Thread[main,5,main])--Begin undeploying Persistence Unit reinders; session reinders_url=jdbc:reinders:com.informix.jdbc.IfxDriver#jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8_user=user; state Deployed; factoryCount 1
[EL Config]: 2011-10-04 16:04:25.614--ServerSession(32112901)--Connection(33083511)--Thread(Thread[main,5,main])--disconnect
2011-10-04 16:04:25,630 INFO nl.knowledgeplaza.util.jdbc.Connection.invoke(Connection.java:148) #18068557[C18068557]: close: java.lang.reflect.InvocationTargetException->java.sql.SQLException: System or internal error com.informix.asf.IfxASFException: Attempt to connect to database server (%s) failed.
2011-10-04 16:04:25,630 INFO nl.reinders.jdbc.ReindersInformixConnection.invoke(ReindersInformixConnection.java:70) close: java.lang.reflect.InvocationTargetException->java.sql.SQLException: System or internal error com.informix.asf.IfxASFException: Attempt to connect to database server (%s) failed.
[EL Finest]: 2011-10-04 16:04:25.63--ServerSession(32112901)--Thread(Thread[main,5,main])--sequencing disconnected
[EL Config]: 2011-10-04 16:04:25.63--ServerSession(32112901)--Connection(12652000)--Thread(Thread[main,5,main])--disconnect
2011-10-04 16:04:25,630 INFO nl.knowledgeplaza.util.jdbc.Connection.invoke(Connection.java:148) #23157279[C23157279]: close: java.lang.reflect.InvocationTargetException->java.sql.SQLException: System or internal error com.informix.asf.IfxASFException: Attempt to connect to database server (%s) failed.
2011-10-04 16:04:25,630 INFO nl.reinders.jdbc.ReindersInformixConnection.invoke(ReindersInformixConnection.java:70) close: java.lang.reflect.InvocationTargetException->java.sql.SQLException: System or internal error com.informix.asf.IfxASFException: Attempt to connect to database server (%s) failed.
[EL Finer]: 2011-10-04 16:04:25.63--ServerSession(32112901)--Thread(Thread[main,5,main])--initialize identitymaps
[EL Info]: 2011-10-04 16:04:25.63--ServerSession(32112901)--Thread(Thread[main,5,main])--reinders_url=jdbc:reinders:com.informix.jdbc.IfxDriver#jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8_user=user logout successful
[EL Config]: 2011-10-04 16:04:25.63--ServerSession(32112901)--Connection(12652000)--Thread(Thread[main,5,main])--disconnect
2011-10-04 16:04:25,630 INFO nl.knowledgeplaza.util.jdbc.PreparedStatement.invoke(PreparedStatement.java:127) #6532616[C1171427]: close: java.lang.reflect.InvocationTargetException->java.sql.SQLException: System or internal error java.net.SocketException: Connection reset by peer: socket write error
2011-10-04 16:04:25,630 INFO nl.knowledgeplaza.util.jdbc.PreparedStatement.invoke(PreparedStatement.java:127) #3586951[C1171427]: close: java.lang.reflect.InvocationTargetException->java.sql.SQLException: System or internal error java.net.SocketException: Connection reset by peer: socket write error
2011-10-04 16:04:25,630 INFO nl.knowledgeplaza.util.jdbc.PreparedStatement.invoke(PreparedStatement.java:127) #22131127[C1171427]: close: java.lang.reflect.InvocationTargetException->java.sql.SQLException: System or internal error java.net.SocketException: Connection reset by peer: socket write error
[EL Config]: 2011-10-04 16:04:25.646--ServerSession(32112901)--Connection(29441291)--Thread(Thread[main,5,main])--disconnect
[EL Finest]: 2011-10-04 16:04:25.646--ServerSession(32112901)--Thread(Thread[main,5,main])--End undeploying Persistence Unit reinders; session reinders_url=jdbc:reinders:com.informix.jdbc.IfxDriver#jdbc:informix-sqli://toeu_reinders:9088/reinders:INFORMIXSERVER=ol_ids_1150_1;DB_LOCALE=en_us.utf8_user=user; state Undeployed; factoryCount 0


I'm not seeing a reconnect.

Tom
Re: pingsql [message #734055 is a reply to message #732332] Thu, 06 October 2011 14:32 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

So, you said that calling setPingSQL worked, but overriding the method did not?

The problem is that the variable pingSQL defines the value. So you need to set this value by overriding the constructor of your platform, not by overriding the method (field is used directly).

You may also want to submit your patch to the InformixPlatform to set the pingSQL.



James : Wiki : Book : Blog : Twitter
Re: pingsql [message #734086 is a reply to message #734055] Thu, 06 October 2011 15:05 Go to previous message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
> So, you said that calling setPingSQL worked, but overriding the method did not?

No. I have tried two ways of setting it. Via the SessionCustomizer and by overriding the getPingSql() on the platform. In neither case the ping SQL is actually called.

>
> The problem is that the variable pingSQL defines the value. So you need to set this value by overriding the constructor of your platform, not by overriding the method (field is used directly).

I have now added a third; setting the variable in the platform's constructor.

>
> You may also want to submit your patch to the InformixPlatform to set the pingSQL.
>
>

Well, it turns out that setting the pingSQL variable in the constructor works:

public InformixPlatform()
{
super();
pingSQL = "select first 1 1 from systables";
}

The SQL is a good one to test the connection, so that could be patched in.

Tom
Previous Topic:DatabaseAccessor not connected and Eingabe/Ausgabe-Fehler
Next Topic:Duplicate strings in o.e.p.internal.jpa.metadata.accessors.objects.MetadataClass
Goto Forum:
  


Current Time: Thu Oct 23 22:04:18 GMT 2014

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

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