db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <Fisc...@seitenbau.net>
Subject AW: Can't handle same column name twice - possibly a bug in village?
Date Thu, 16 Dec 2004 09:52:52 GMT




Hi Daniel,

looking into village, it extracts the tablename from the metadata and looks
if there are different tables (com.workingdogs.village.Column.populate())
Now, my oracle driver returns null as tablename, so village assumes the
results stem from a single table, the crucial call being
         this.tableName = rsmd.getTableName(columnNumber);
where rsmd is the Metadadat of the resultSet

However, in the crucial code where the ResultSet is populated
(com.workingdogs.village.Record), no reference is made to the tablename:

    private void createValues(ResultSet rs) throws DataSetException,
    SQLException
    {
        for (int i = 1; i <= size(); i++)
        {
            Value val = new Value (rs, i, schema().column(i).typeEnum());
            this.values[i] = val;
        }
    }

so there should be no problem there, whatever the tablename detection does.
Can you use a debug-enabled version of village (I can send one to you if yo
do not already have one), set a breakpoint in
com.workingdogs.village.Record(DataSet ds), step through your test code and
see how the record is populated ? Take the possibility into account that
there might be a bug in your database driver...

     Thomas


"Vitzethum, Daniel" <Daniel.Vitzethum@gigatronik.com> schrieb am 16.12.2004
09:47:00:

> Hello Henning and Thomas,
>
> > I still cannot reproduce your error
> *sigh*
>
> > I used your code below and get
> > [{'1','10','100','100','20'}]
>
> Now that's really strange to me. Both of you tell me that village is
> not responsible for that, but the error occurs - in my environment -
> definitely _below_ Torque.
>
> In BasePeer.executeQuery(String, int, int, boolean, Connection),
> that line is executed:
>   ...
>   qds = new QueryDataSet(con, queryString);
>
> The QueryDataSet constructs a new Schema object that lacks a table name.
> These values are taken from 'qds' after that line of code:
>   [qds]
>   schema={'P_ID','G_ID','L_ID','L_ID','G_ID'}
>   selectString=SELECT TEST_PERSON.P_ID, TEST_PERSON.G_ID,
> TEST_PERSON.L_ID
>     , TEST_LENDING.L_ID, TEST_LENDING.G_ID FROM TEST_PERSON,
> TEST_LENDING
>     WHERE TEST_PERSON.L_ID=TEST_LENDING.L_ID
>
> It seems to me that 'schema' that has same column names for different
> cols is the problem.
>
> Later on, in BasePeer.getSelectResults(QueryDataSet, int, int, boolean),
> qds.fetchRecords() is called and leads to that representation of 'qds':
>   {'P_ID','G_ID','L_ID','L_ID','G_ID'}
>   {'1',   '10',  '100', '100', '10'}
>
> Maybe I appear a bit bullheaded - I can't believe that this is a problem
> of Torque!
>
> The QueryDataSet is constructed from a connection and a sql
> String and internally builds a 'Schema' object from DB metadata.
> Could that metadata be erroneous/misleading in my case?
>
> > Perhaps you have uncommited data on a connection you use that is not
> > visible to other connections/applications ?
> No, that's very unlikely. I created the tables just for the last post.
>
> > I am quite sure that village is not the problem here.
> Hm, but what else?
>
>
>
> Still unsatisfied,
>
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message