Re: java app shuts down Informix Server
Posted in 2003
--0__=08BBE493DFE831C68f9e8a93df938690918c08BBE493DFE831C6 Content-type: multipart/alternative; Boundary="1__=08BBE493DFE831C68f9e8a93df938690918c08BBE493DFE831C6" --1__=08BBE493DFE831C68f9e8a93df938690918c08BBE493DFE831C6 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable I can think of other sources of potential problems other than JDBC or m= aybe at least one - memory. Before you can draw any firm conclusions you may want to try some approaches to try and narrow down some of the potential sources of the error. If the query can run from any other client tool, you can in all probability eliminate the server as the cause. You= may want to try and run a memory analyzer tool against you application. You= might want to check if you are employing default connection or command timeouts (which may be insufficient ). Are u opening any new connectio= ns or statements (or preparing statements or allocating resources in gener= al ) inside the loop for any reason? If so, do you close them? Sincerely Rajesh Nair IBM Data Management Solutions rajeshn@us.ibm.com Tel: (913) 599 7201 "The difference between genius and stupidity is: genius has its limits.= " |---------+----------------------------> | | "Mel Haynes Jr" | | | <mhaynesjr@hotmai| | | l.com> | | | Sent by: | | | owner-informix-li| | | st@iiug.org | | | | | | | | | 12/18/2003 01:46 | | | PM | | | Please respond to| | | "Mel Haynes Jr" | | | | |---------+----------------------------> >--------------------------------------------------------------------= ------------------------------------------------------| | = | | To: informix-list@iiug.org = | | cc: = | | Subject: java app shuts down Informix Server = | | = | >--------------------------------------------------------------------= ------------------------------------------------------| Hi all, I am getting reports from a customer saying my Java application is caus= ing the Informix server to crash. He reports that it started causing proble= ms when they started processing large amounts of data ( millions of rows? = ). They have had to restart the Informix server several times to get the processing complete. What he does is restart the database and then run = the process again. After 4 tries, it seems to complete. So my guess is afte= r a certain amount of data, the Informix server gets unhappy. I am happy to= have my java app take the blame, but nothing is giving me any clues as to wh= y its freezing the server. Here is my app setup: I am using the JDBC driver from IBM( the latest one from like June 03 o= r something ). I am very suspicious of this driver. I am trying to convin= ce customers to migrate to a better JDBC driver like DataDirect, but I nee= d to be able to say the JDBC driver is causing the problems. Informix Server 9.3 on an HP machine ( not sure what type, but this pro= blem happened on a Sun Solaris as well ). The app they are running is fairly simple. It opens a cursor ( SELECT *= FROM Table WHERE X=3DY ). That Query may result in the million+ rows, but I = use a cursor so its in a loop: while(rs.next) { ... do stuff ... } rs.close() The bizarre part is the exceptions java returns points to the top of th= e loop ( while( rs.next() ). Not anything fancy and it seems to run throu= gh many rows before it even throws an exception. The other part it crashes= is at that rs.close() statement. So its not throwing any exceptions at any= logic portion of the code and the exceptions that are being thrown are = no help to anyone. Here is what is returned: ava.sql.SQLException: System or internal error at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:348) at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2202) at com.informix.jdbc.IfxSqli.executeClose(IfxSqli.java:1740) at com.informix.jdbc.IfxResultSet.close(IfxResultSet.java:1589) at The customer also looked at the Informix log to find this amazing error= message -22 Invalid argument. My suspicions are either the JDBC driver is not designed for this type = of load ( it is free from IBM, what do I expect? ) or the database is not tuned for that load, or perhaps there are some leaks in my app that keep cert= ain resources open. I am no DBA so I can't really track down the database issues. I know Informix deals with this type of load factor all the time so I a= m not thinking its the DB server at all. I would just like some clues to help= figure out what the problem is. Can anyone point me in a direction to h= elp pinpoint the problem? Perhaps anyone with horror stories using this JDB= C driver? Thanks to everyone. Also can someone explain something to me? If I open a cursor that may contain a million+ rows, how does Informix handle that? What I mean is = the cursor on in my app retrieves one row at a time, but does Informix have= to load them all into memory first or what? I am fasinated by how database= s do their magic and wonder if perhaps I should take the DB server into consideration when creating a cursor of that size ( everything IS index= ed btw ). Mel Haynes Jr = --1__=08BBE493DFE831C68f9e8a93df938690918c08BBE493DFE831C6 Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable <html><body> <p>I can think of other sources of potential problems other than JDBC o= r maybe at least one - memory. <br> Before you can draw any firm conclusions you may want to try some appro= aches to try and narrow down some of the potential sources of the error= . If the query can run from any other client <br> tool, you can in all probability eliminate the server as the cause. You= may want to try and run a memory analyzer tool against you application= . You might want to check if you are employing default connection or co= mmand timeouts (which may be insufficient ). Are u opening any new con= nections or statements (or preparing statements or allocating resources= in general ) inside the loop for any reason? If so, do you close them?= <br> <b