db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sonu Vijay <son...@yahoo.com>
Subject RE: How to add P6Spy: WAS: Printing SQL
Date Thu, 11 Dec 2003 17:47:41 GMT
Hi Siegfried,

I have done a lot of testing and the located the
problem. The problem is that before doing an insert
they check in the Torque(village infact) code if a
column in a table is readOnly. And they do this
checking by using the ResultSetMetaData from the
ResultSet of a Select statement. I mean that's what I
could find.

And this damn DB2400 of mine, always returns
readOnly=true and when Torque sees that the column is
readOnly it refuses to insert data in it.

I wrote seperate progams to insert data and inserts
work very smoothly but when I try to use the
ResultSetMetaData again i Get readOnly=true.

But ResultSetMetaData and DatabaseMetaData are two
different things. The first on comes from the
resultset of a select, the second one doesn't.

And I can manually set readOnly property = false in
the Village code and things work perfectly fine.

So I was wondering what's was the reason for chosing
to use the ResultSetMetaData and not the
DatabaseMetaData in Torque.

But now I feel that I"m asking some extremely stupid
beginners question cause nobody seems to pay any
attention to it :-) :-)

Neither here nor in the sun java list.

So I"m going to just shut up and hard code
readOnly=false in Village classes and use that.

Thanks for your responses.





--- "Göschl,Siegfried" <Siegfried.Goeschl@drei.com>
wrote:
> Hi Vikas,
> 
> this is way beyond my knowledge ... :-)
> 
> +) Shouldn't the insert be handled on the
> application level, e.g. it doesn't make any sense to
> insert a record in a view but on the application
> level you know that you are working on a view
> 
> +) If I remember correctly you are working on DB2 on
> AS400 which seems to be quite troublesome. What
> about writing a JUNIT test to test this behaviour
> for your database/application. This is the way I go
> - setup the regression tests, get them running and
> then turn the regression test into a load test to
> hammer the database.
> 
> +) If you want to change this properly put the stuff
> into the XXX.java classes since the are not
> overwritten by the next round of generation.
> 
> Cheers,
> 
> Siegfried Goeschl
> 
> -----Original Message-----
> From: Sonu Vijay [mailto:sonupv@yahoo.com]
> Sent: Tuesday, December 09, 2003 10:23 PM
> To: Apache Torque Users List
> Subject: Re: How to add P6Spy: WAS: Printing SQL
> 
> 
> Siegfried,
> 
> Could you pls give me an opinion on something. I
> need
> to know that before making an insert into a table,
> if
> I want to check whether the table or its
> corresponding
> column is readOnly, then what would be the best and
> generic way to do that:
> 
> 1. Do some kind of select on that table and then get
> the ResultSetMetaData from the returned resultSet.
> 
> or
> 
> 2.Get the use the DataBaseMetaData for the tables in
> that database.
> 
> Thanks
> 
> Vikas
> 
> 
> 
> --- "Göschl,Siegfried" <Siegfried.Goeschl@drei.com>
> wrote:
> > Hi Sonu,
> > 
> > some help for an entry level programmer with a
> > console application - life is harsh sometimes  ...
> > :-)
> > 
> > +) add the p6spy.jar to your classpath
> > +) copy the spy.properties into your classpath
> (same
> > location as log4j.properties)
> > +) set the real driver in spy.properties, e.g.
> > realdriver=oracle.jdbc.driver.OracleDriver in my
> > case
> > +) change the Torque.properties, e.g.
> > torque.dsfactory.XXX.connection.driver =
> > com.p6spy.engine.spy.P6SpyDriver
> > 
> > The program creates a spy.log in your current
> > directory ... piece of cake looking at it ... ;-)
> > 
> > Cheers,
> > 
> > Siegfried Goeschl
> > 
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail:
> > torque-user-help@db.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> 
>
---------------------------------------------------------------------
> 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
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

---------------------------------------------------------------------
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