RE: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 7.

From: Bill Fan (bil..anscom.com.au)
Date: Wed Dec 17 2003 - 05:03:05 EST

  • Next message: Jim Menard: "Re: Flattened relationships are read-only?"

    Hi Andrus,

    Thanks very much for your quick response!

    Yes, I'm still using an old version of Cayenne - v1.0a5. I had a bit of
    backward compatibility problems when I tried to use the later Modeler to
    re-generate the class files, so I kept using the one I used at the
    beginning. It worked quite well indeed except this problem occurred
    sometimes...

    As suggested, I'm trying to use Cayenne v1.0.4. Need to modify the way to
    get the DataContext in all the action classes(I'm using Struts) and the
    listener configuration in the web.xml file.

    //Cayenne 1.0a5
    //DataContext ctxt = ServletConfiguration.getDefaultContext(session);
                    
    //Cayenne 1.0.4
    DataContext ctxt = BasicServletConfiguration.getDefaultContext(session);

    Will post further message to confirm once I get the app updated and tested.

    Thanks for your help!

    Bill

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: Wednesday, December 17, 2003 2:51 AM
    To: cayenne-use..bjectstyle.org
    Subject: Re: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not
    re-read row data for column 7.

    On Dec 16, 2003, at 5:42 AM, Bill Fan wrote:

    > Hi,
    >  
    > This problem sometimes (not always...) happened in my web application.
    > I understand this is something to do with MS SQL database. I'm not
    > sure how I can fix it when I'm using Cayenne.
    >  
    > The way to fix it In the straight JDBC way, I would specify the table
    > columns in a particular order in the sql query so that the columns
    > with primitive data type(int, float, char etc) appears first, then the
    > varchar columns, then the text columns appear last. When the resultset
    > is being looping through, I would retrieve the values
    > following straightly the order of columns in the query. With Cayenne,
    > I'm running out of idea....
    >  
    > Please note, the line has problem in the function below as indicated
    > by the Stack trace is
    >  
    >         List issueRows = ctxt.performQuery(query);

    Hi Bill,

     From what I I understand, this error happens when the same column in
    the result set is read more than once (or maybe some variations of
    this). Right away I can't think of a reason why Cayenne would do that.
    To track it down further could you provide some more information:

    1. What version of Cayenne are you using? The fact that
    CayenneRuntimeException message doesn't contain Cayenne version string
    (e.g. "org.objectstyle.cayenne.CayenneRuntimeException: [v.1.0.4 Dec 14
    2003]"), makes me think that it is pretty old. If this is indeed the
    case, could you try it with the latest version.

    2. What SQL is generated for the query before the exception is thrown?

    Thanks
    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Dec 17 2003 - 05:03:04 EST