Re: invalid packet type, DefaultResultIterator

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Jan 17 2005 - 23:04:13 EST

  • Next message: Elia Morling: "Re: Debugging Faults"

    Hi,

    It is very unlikely that fetching only 500 objects just a few times
    would cause OutOfMemory errors in default Cayenne/Tapestry setup...
    However I remember a problem with Tomcat 4.* that caused it to crash
    when using hot redeployment feature. It was purely a Tomcat problem
    that I couldn't quiet nail down. I ended up restarting it every time I
    redeploy. But what you are saying is that it happens even without
    multiple redeployments?

    Hmmm... You need to turn on Cayenne logging (actually I suspect it is
    on already, but just inc ase -
    http://objectstyle.org/cayenne/userguide/deploy/logging.html), and
    inspect the log generated in $CATALINA_HOME/log/catalina.out. I suggest
    stopping Tomcat, deleting all files under $CATALINA_HOME/log/, starting
    it again and sending requests to app until it crashes, and then
    inspecting the log... At least you'll see all the Cayenne-generated SQL
    plus the counts of objects read into memory. Check if there is anything
    abnormal, anything you didn't expect to fetch, etc...

    Hope this helps.

    Andrus

    On Jan 17, 2005, at 2:01 PM, Jin Lee wrote:

    > Hey all,
    >
    > This is a continuation of my last post labeled "Cayenne, tapestry,
    > tomcat plumbing". I've tweaked my code quite alot, consulted the
    > tapestry boards, and read as much as I could, but I still can't figure
    > out what is quite happening with my application. Here is the summary
    > of the problem:
    >
    > There is a table called TblPerson, which contains around 500 rows.
    > I've scaled down the ObjEntity and the DbEntity so that the only 3
    > fields I grab from the databse are PersonID, FirstName, and LastName.
    >
    > Here is what is happening:
    >
    > When I restart the tomcat server, the application runs fine. The page
    > does take about 5 seconds on average to load, but I believe that is
    > because the names are populating an html <select> field and it takes
    > time to render.
    >
    > Somewhere between 10 to 15 reloads of the same page, the application
    > starts to break down. The most common error I see is a
    > OutofMemoryError. Occasionally, I will get a different error, which
    > is:
    >
    > java.sql.SQLException: TDS Protocol error: Invalid packet type 0xa
    > .
    > .
    > .
    > org.objectstyle.cayenne.access.DefaultResultIterator.close(DefaultResul
    > tIterator.java:363)
    >
    > I am accessing SQLServer using the jtds JDBC driver
    > (jdts.sourceforge.net).
    >
    > Here is the catch: Even if I reload the web application, it still
    > continues to not work. It is only after I've stopped and restarted
    > tomcat is when it will start working, 10-15 times before it breaks
    > again.
    >
    > Without knowing the inner workings of either technology, I am thinking
    > the error lies in:
    > 1) connection pooling
    > 2) reusable components in tapestry
    >
    > I've also increased the JVM memory settings (using the -Xmx flag) to
    > 256 megs.
    >
    > This error is very specific and I know this is a longshot, but any
    > advice/suggestions would be much appreciated. Thank you all very much,
    >
    > Jin Lee
    >



    This archive was generated by hypermail 2.0.0 : Mon Jan 17 2005 - 23:04:19 EST