You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by David Sean Taylor <da...@bluesunrise.com> on 2002/04/18 07:28:57 UTC
Sql select statements in log
Anyone know why the following select statements are now logged with
every request....
[22:19:22,415 DEBUG] SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE WHERE
(TURBINE_ROLE.ROLE_NAME='turbine')
[22:19:22,425 DEBUG] SELECT TURBINE_PERMISSION.PERMISSION_ID,
TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA FROM
TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE
(TURBINE_ROLE_PERMISSION.ROLE_ID=6) AND
TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID
ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Sql select statements in log
Posted by Glenn Golden <gg...@mac.com>.
On Thursday, April 18, 2002, at 03:10 PM, Chris Kimpton wrote:
>
>> David Sean Taylor wrote:
>>
>>>> Use Log.getLogger().isDebugEnabled() for the default logger.
>>>>
>>>
>>> I propose that we use this convention for all logging.
>
>
> +1
>
>
> I was going to argue that the performance gain on a simple string log
> would be minimal - versus the ease of reading the code - until I
> tried it...
>
> There was no performance gain - and when you do any calculations in
> the logging message, it gets really slow - 100 times slower!
with this test done (thanks, Chris!), that clinches it for me!
Here's my first official vote!
+1
- Glenn
---------------------------------------------------------------------
Glenn R. Golden Systems Research Programmer
School of Information University of Michigan
ggolden@umich.edu 734-615-1419
---------------------------------------------------------------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Sql select statements in log
Posted by Chris Kimpton <ki...@yahoo.com>.
> David Sean Taylor wrote:
>
> >>Use Log.getLogger().isDebugEnabled() for the default logger.
> >>
> >
> > I propose that we use this convention for all logging.
+1
I was going to argue that the performance gain on a simple string log
would be minimal - versus the ease of reading the code - until I
tried it...
There was no performance gain - and when you do any calculations in
the logging message, it gets really slow - 100 times slower!
So - go for it...
Chris
=====
------------------------------------------
http://www.soccer2002.org.uk
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Sql select statements in log
Posted by Paul Spencer <pa...@apache.org>.
David Sean Taylor wrote:
>>Use Log.getLogger().isDebugEnabled() for the default logger.
>>
>
> I propose that we use this convention for all logging.
+1
>
>
>
>>-----Original Message-----
>>From: Paul Spencer [mailto:paulsp@apache.org]
>>Sent: Thursday, April 18, 2002 9:53 AM
>>To: Jetspeed Developers List
>>Subject: Re: Sql select statements in log
>>
>>
>>David,
>>
>>
>>David Sean Taylor wrote:
>><snip>
>>
>>>Speaking of logging, do you know how to do something like this:
>>>
>>> if (logging enabled for debug)
>>> Log.debug( "WebPagePortlet caching URL: " +
>>> url +
>>> " Expiration: " +
>>> pageExpiration +
>>> ", " +
>>> (pageExpiration -
>>>
>>System.currentTimeMillis() ) +
>>
>>> " milliseconds into the future" );
>>>
>>>
>>
>>Use Log.getLogger().isDebugEnabled() for the default logger.
>>We currently only use the default logger.
>>
>> if (Log.getLogger().isDebugEnabled())
>> Log.debug("First name = " + firstName
>> + ", lastName = " + lastName
>> + ", address = " + address);
>>
>>
>>
>>>So that we don't have to construct all parameters even when debug
>>>level is off?
>>>
>>>
>>>
>>
>>Paul Spencer
>>
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:jetspeed-dev-> unsubscribe@jakarta.apache.org>
>>For
>>additional commands,
>>e-mail: <ma...@jakarta.apache.org>
>>
>>
>
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Sql select statements in log
Posted by David Sean Taylor <da...@bluesunrise.com>.
> Use Log.getLogger().isDebugEnabled() for the default logger.
I propose that we use this convention for all logging.
> -----Original Message-----
> From: Paul Spencer [mailto:paulsp@apache.org]
> Sent: Thursday, April 18, 2002 9:53 AM
> To: Jetspeed Developers List
> Subject: Re: Sql select statements in log
>
>
> David,
>
>
> David Sean Taylor wrote:
> <snip>
>
> > Speaking of logging, do you know how to do something like this:
> >
> > if (logging enabled for debug)
> > Log.debug( "WebPagePortlet caching URL: " +
> > url +
> > " Expiration: " +
> > pageExpiration +
> > ", " +
> > (pageExpiration -
> System.currentTimeMillis() ) +
> > " milliseconds into the future" );
> >
>
>
> Use Log.getLogger().isDebugEnabled() for the default logger.
> We currently only use the default logger.
>
> if (Log.getLogger().isDebugEnabled())
> Log.debug("First name = " + firstName
> + ", lastName = " + lastName
> + ", address = " + address);
>
>
> > So that we don't have to construct all parameters even when debug
> > level is off?
> >
> >
>
>
> Paul Spencer
>
>
> --
> To unsubscribe, e-mail:
> <mailto:jetspeed-dev-> unsubscribe@jakarta.apache.org>
> For
> additional commands,
> e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Sql select statements in log
Posted by Paul Spencer <pa...@apache.org>.
David,
David Sean Taylor wrote:
<snip>
> Speaking of logging, do you know how to do something like this:
>
> if (logging enabled for debug)
> Log.debug( "WebPagePortlet caching URL: " +
> url +
> " Expiration: " +
> pageExpiration +
> ", " +
> (pageExpiration - System.currentTimeMillis() ) +
> " milliseconds into the future" );
>
Use Log.getLogger().isDebugEnabled() for the default logger. We currently only use the default logger.
if (Log.getLogger().isDebugEnabled())
Log.debug("First name = " + firstName
+ ", lastName = " + lastName
+ ", address = " + address);
> So that we don't have to construct all parameters even when debug level
> is off?
>
>
Paul Spencer
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Sql select statements in log
Posted by Santiago Gala <sg...@hisitech.com>.
David Sean Taylor wrote:
>>I started noticing those messages as soon as I started asking for
>>Permissions, but I'm not sure about the runtime cost (yet).
>>
>>
>
>It seems to be hitting the database several times per request. This is
>not good.
>
>Is there a way to turn off security permission checks on portlet
>aggregation?
>
Not so simple. I can think something about, but it should not be
necessary. See below.
>In my projects, I have no need for security checks at this time.
>Security checks during customization are sufficient for most systems
>I've worked on.
>
>
>
Turbine ACL should be cached, at least per request. So, I will look
where is the problem coming from.
Also, I'm thinking of putting the Security constraints together with the
portlet in the Wrapper. So checks would be much cheaper to do.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Sql select statements in log
Posted by David Sean Taylor <da...@bluesunrise.com>.
> I started noticing those messages as soon as I started asking for
> Permissions, but I'm not sure about the runtime cost (yet).
It seems to be hitting the database several times per request. This is
not good.
Is there a way to turn off security permission checks on portlet
aggregation?
In my projects, I have no need for security checks at this time.
Security checks during customization are sufficient for most systems
I've worked on.
> -----Original Message-----
> From: Santiago Gala [mailto:sgala@hisitech.com]
> Sent: Thursday, April 25, 2002 8:25 AM
> To: Jetspeed Developers List
> Subject: Re: Sql select statements in log
>
>
> Chris Kimpton wrote:
>
> >Hi,
> >
> >--- David Sean Taylor <da...@bluesunrise.com> wrote:
> >
> >
> >>>If its in the same request, and the same "query", Torque should
> >>>
> >>>
> >>cache
> >>
> >>
> >>>the result... and save a DB hit.
> >>>
> >>>
> >
> >Have you noticed extra DB calls since the torque upgrade?
> >
> >
> I started noticing those messages as soon as I started asking for
> Permissions, but I'm not sure about the runtime cost (yet).
>
> Sorry, I'm not (yet) dead.
>
> >There is an optional manager/cache feature, which is turned off by
> >default - not sure exactly what it does - it wasn't in the older
> >version of Torque... there is a chance that there was basic built-in
> >caching in the old Torque and now it is decoupled...
> >
> >Chris
> >
> >=====
> >------------------------------------------
> >http://www.soccer2002.org.uk
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
>
>--
>To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Sql select statements in log
Posted by Santiago Gala <sg...@hisitech.com>.
Chris Kimpton wrote:
>Hi,
>
>--- David Sean Taylor <da...@bluesunrise.com> wrote:
>
>
>>>If its in the same request, and the same "query", Torque should
>>>
>>>
>>cache
>>
>>
>>>the result... and save a DB hit.
>>>
>>>
>
>Have you noticed extra DB calls since the torque upgrade?
>
>
I started noticing those messages as soon as I started asking for
Permissions, but I'm not sure about the runtime cost (yet).
Sorry, I'm not (yet) dead.
>There is an optional manager/cache feature, which is turned off by
>default - not sure exactly what it does - it wasn't in the older
>version of Torque... there is a chance that there was basic built-in
>caching in the old Torque and now it is decoupled...
>
>Chris
>
>=====
>------------------------------------------
>http://www.soccer2002.org.uk
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Tax Center - online filing with TurboTax
>http://taxes.yahoo.com/
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Sql select statements in log
Posted by Chris Kimpton <ki...@yahoo.com>.
Hi,
--- David Sean Taylor <da...@bluesunrise.com> wrote:
> > If its in the same request, and the same "query", Torque should
> cache
> > the result... and save a DB hit.
>
Have you noticed extra DB calls since the torque upgrade?
There is an optional manager/cache feature, which is turned off by
default - not sure exactly what it does - it wasn't in the older
version of Torque... there is a chance that there was basic built-in
caching in the old Torque and now it is decoupled...
Chris
=====
------------------------------------------
http://www.soccer2002.org.uk
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Sql select statements in log
Posted by David Sean Taylor <da...@bluesunrise.com>.
> If its in the same request, and the same "query", Torque should cache
> the result... and save a DB hit.
Yes, that can really add up.
Speaking of logging, do you know how to do something like this:
if (logging enabled for debug)
Log.debug( "WebPagePortlet caching URL: " +
url +
" Expiration: " +
pageExpiration +
", " +
(pageExpiration - System.currentTimeMillis() ) +
" milliseconds into the future" );
So that we don't have to construct all parameters even when debug level
is off?
> -----Original Message-----
> From: Chris Kimpton [mailto:kimptoc_mail@yahoo.com]
> Sent: Thursday, April 18, 2002 1:54 AM
> To: Jetspeed Developers List
> Subject: RE: Sql select statements in log
>
>
> Hi,
>
> --- David Sean Taylor <da...@bluesunrise.com> wrote:
> > I don't care about the logging, I can turn that off.
> > The part that concerns me is that we seem to be repeatly retrieving
> > the permissions and roles form the database on every request.
> >
>
> If its in the same request, and the same "query", Torque should cache
> the result... and save a DB hit.
>
> Chris
>
> =====
> ------------------------------------------
> http://www.soccer2002.org.uk
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> --
> To unsubscribe, e-mail:
> <mailto:jetspeed-dev-> unsubscribe@jakarta.apache.org>
> For
> additional commands,
> e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Sql select statements in log
Posted by Chris Kimpton <ki...@yahoo.com>.
Hi,
--- David Sean Taylor <da...@bluesunrise.com> wrote:
> I don't care about the logging, I can turn that off.
> The part that concerns me is that we seem to be repeatly retrieving
> the
> permissions and roles form the database on every request.
>
If its in the same request, and the same "query", Torque should cache
the result... and save a DB hit.
Chris
=====
------------------------------------------
http://www.soccer2002.org.uk
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Sql select statements in log
Posted by David Sean Taylor <da...@bluesunrise.com>.
I don't care about the logging, I can turn that off.
The part that concerns me is that we seem to be repeatly retrieving the
permissions and roles form the database on every request.
> -----Original Message-----
> From: Chris Kimpton [mailto:kimptoc_mail@yahoo.com]
> Sent: Wednesday, April 17, 2002 11:52 PM
> To: Jetspeed Developers List
> Subject: Re: Sql select statements in log
>
>
> Hi,
>
> --- David Sean Taylor <da...@bluesunrise.com> wrote:
> > Anyone know why the following select statements are now logged with
> > every request....
> >
> > [22:19:22,415 DEBUG] SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE
> > WHERE
> > (TURBINE_ROLE.ROLE_NAME='turbine')
> > [22:19:22,425 DEBUG] SELECT TURBINE_PERMISSION.PERMISSION_ID,
> > TURBINE_PERMISSION.PERMISSION_NAME,
> TURBINE_PERMISSION.OBJECTDATA FROM
> > TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE
> > (TURBINE_ROLE_PERMISSION.ROLE_ID=6) AND
> >
> TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID
> > ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
> >
>
> Its do with the logging level - if its set to DEBUG, you get
> the SQL ops - I presume from torque.
>
> You could either switch it to INFO. Which basically means
> less logging.
>
> Or you can get fancier with the log4j config and just select
> DEBUG for your classes/categories...
>
> If you put %c in the output pattern, this will show you which
> logger/category a log line is from and thus you could use the
> appender config to filter to that category.
>
> HTH,
> Chris
>
> =====
> ------------------------------------------
> http://www.soccer2002.org.uk
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Sql select statements in log
Posted by Chris Kimpton <ki...@yahoo.com>.
Hi,
--- David Sean Taylor <da...@bluesunrise.com> wrote:
> Anyone know why the following select statements are now logged with
> every request....
>
> [22:19:22,415 DEBUG] SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE
> WHERE
> (TURBINE_ROLE.ROLE_NAME='turbine')
> [22:19:22,425 DEBUG] SELECT TURBINE_PERMISSION.PERMISSION_ID,
> TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA
> FROM
> TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE
> (TURBINE_ROLE_PERMISSION.ROLE_ID=6) AND
>
TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID
> ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
>
Its do with the logging level - if its set to DEBUG, you get the SQL
ops - I presume from torque.
You could either switch it to INFO. Which basically means less
logging.
Or you can get fancier with the log4j config and just select DEBUG
for your classes/categories...
If you put %c in the output pattern, this will show you which
logger/category a log line is from and thus you could use the
appender config to filter to that category.
HTH,
Chris
=====
------------------------------------------
http://www.soccer2002.org.uk
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>