Re: Which class to modify to clock sql statements ?

Armin Waibel <[email protected]>
Newsgroups gmane.comp.jakarta.ojb.user
Message-ID <[email protected]>
Bruno CROS wrote:
> Hi,
> 
> Hum, last year i tried P6SPY and find a big bug. queries don't work as they
> would do. I already talked about that in that forum.
> 
> And, we have to time in production (P6SPY is not recommended for that).
> 
> Well, i wrote some code in JdbcAccessImpl.java and i well get usefull 
> times.
> It get measures and sql request for executeQuery( ...) method ,  but not 
> for
> method such executeUpdate(ClassDescriptor cd, Object o) because i didn't 
> get
> the sql instruction ( UPDATE TABLE SET XXX=..." WHERE ... ). How can i 
> reach
> the sql instruction? Measuring time without the query is a little useless .
> A fine cast may be ?
>

Try this:
final String sql = 
broker.serviceSqlGenerator().getPreparedUpdateStatement(cld).getStatement();

regards,
Armin

> Thanks.
> 
> Regards.
> 
> 
> On 12/15/06, Charles Anthony <[email protected]> wrote:
>>
>> Hi,
>>
>> Another option would be to use the p6spy jdbc driver
>> http://www.p6spy.com/ which, if I remember correctly logs the time taken
>> to execute the statement as well as the statement itself.
>>
>>
>> Cheers,
>>
>> Charles.
>>
>> > -----Original Message-----
>> > From: Armin Waibel [mailto:[email protected]]
>> > Sent: 15 December 2006 01:24
>> > To: OJB Users List
>> > Subject: Re: Which class to modify to clock sql statements ?
>> >
>> > Bruno CROS wrote:
>> > >  Hi,
>> > >
>> > > Well, i just want to mesure the time a sql statement takes
>> > to be post
>> > > (sql commit too). I looked a bit in broker.accesslayer
>> > package and in
>> > > StatementForClassImpl.java. Is it the right place to do this ?
>> > >
>> >
>> > I would recommend to have a look in class JdbcAccessImpl to
>> > clock query execution time.
>> >
>> > regards,
>> > Armin
>> >
>> > > May be someone wrote an implementation?
>> > >
>> > > Working with 1.0.4....
>> > >
>> > > Thanks for advices.
>> > >
>> > > Regards.
>> > >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [email protected]
>> > For additional commands, e-mail: [email protected]
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.