I am attempting to program Java objects to access a database on an AS/400 using the jt400 jdbc drivers.
The first run of the PHP script runs fine (but slow, because of the driver loading...) Running the same page a second time yields a script timeout. The Java Object hangs on the query execution. I have been trying to figure this out for a couple weeks now, and I will soon be coming down to the wire of having to maybe try JSP, or Serverlets to make this application...but that's besides the point.
During the execution of the Java object, I load the driver, create the statement, and execute into a resultset. At the end of the script execution, I run the cleanup method which closes the resultset, closes the statement, and closes the connection.
I cannot understand what would be making the execution of the SQL statement hang (to the point where php times out.) I am running the same query, or a slightly modified one (looking for a different field value.) After I let the system sit for a while (5 minutes or so?), the page executes again just fine...slow (because of driver loading), but fine otherwise. It is almost as if something is keeping a lock on the database connection which eventually times out. BTW - the apache thread runs forever at 99-100% CPU usage...until the process is killed (most of the time.)
What might be causing this problem? If there is a simple solution, is there an easy way around the driver loading time (load it once and keep it in memory)? The second question I am sure I can figure out on my own with a little research, but the first is a blockage that I am unable to overcome.
I am able to provide code samples that exhibit this behavior upon request (both stripped down php, and java.)
Thanks for any help you may be able to provide, I am extremely frustrated at the moment.
JDK is IBM 1.1.8
JDBC Driver is from the JT400 ToolKit, version 2.0.1
PHP is 4.0.3pl1
-Pete
The first run of the PHP script runs fine (but slow, because of the driver loading...) Running the same page a second time yields a script timeout. The Java Object hangs on the query execution. I have been trying to figure this out for a couple weeks now, and I will soon be coming down to the wire of having to maybe try JSP, or Serverlets to make this application...but that's besides the point.
During the execution of the Java object, I load the driver, create the statement, and execute into a resultset. At the end of the script execution, I run the cleanup method which closes the resultset, closes the statement, and closes the connection.
I cannot understand what would be making the execution of the SQL statement hang (to the point where php times out.) I am running the same query, or a slightly modified one (looking for a different field value.) After I let the system sit for a while (5 minutes or so?), the page executes again just fine...slow (because of driver loading), but fine otherwise. It is almost as if something is keeping a lock on the database connection which eventually times out. BTW - the apache thread runs forever at 99-100% CPU usage...until the process is killed (most of the time.)
What might be causing this problem? If there is a simple solution, is there an easy way around the driver loading time (load it once and keep it in memory)? The second question I am sure I can figure out on my own with a little research, but the first is a blockage that I am unable to overcome.
I am able to provide code samples that exhibit this behavior upon request (both stripped down php, and java.)
Thanks for any help you may be able to provide, I am extremely frustrated at the moment.
JDK is IBM 1.1.8
JDBC Driver is from the JT400 ToolKit, version 2.0.1
PHP is 4.0.3pl1
-Pete