tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morgan Delagrange <mdela...@yahoo.com>
Subject RE: DBTags in WebLogic 6.0
Date Wed, 15 Aug 2001 20:08:54 GMT

--- "Halvorson, Loren" <Loren.Halvorson@firepond.com>
wrote:
> Morgan,
> 
> I decompiled the JSP servlet WebLogic created that
> contains the two
> ResultSet tags and tried to trace through it to see
> what WebLogic is doing
> wrong, but it wasn't immediately obvious to me.  But
> something seems fishy.
> If the doStartTag() is returning SKIP_BODY, it still
> seems to be writing out
> the previously cached body in the doEndTag() (Am I
> reading this right?)
> 
> Here's the snippet of the compiled JSP page that may
> be interesting.  I
> condensed it by eliminating what I believe to be
> irrelevant lines of code.
> 
> public void _jspService(...)
> {
>   ResultSetTag resultsettag = null;
> 
>   if(resultsettag == null)
>     resultsettag = new ResultSetTag();
>   j = resultsettag.doStartTag();
>   if(j == 1)
>     throw new JspTagException("cannot return
> Tag.EVAL_BODY_INCLUDE");
>   if(j != 0)  <--- ****** SKIP_BODY is 0
>   {
>     : <--- ******* iteration occurs here
>   }
>   if(resultsettag.doEndTag() == 5)
>   {
>     _releaseTags(resultsettag);
>     return;
>   }
>   obj = resultsettag.getParent();
>   resultsettag.release();
>   :
>   ******* Then the whole thing repeats again
>   if(resultsettag == null)
>     resultsettag = new ResultSetTag();
>   int j2 = resultsettag.doStartTag();
>   if(j2 == 1)
>     throw new JspTagException("cannot return
> Tag.EVAL_BODY_INCLUDE");
>   if(j2 != 0)
>   {
>     : <--- ******* iteration occurs here
>   }
>   if(resultsettag.doEndTag() == 5)
>   {
>     _releaseTags(resultsettag);
>     return;
>   }
>   resultsettag.release();
> 
> According to this post on the BEA newsgroup,
> release() is the place to clean
> up state.
>
http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.develo
> per.interest.jsp&item=4710&utag=

According to my understanding, that's overkill.  From
my conversions with some of the JSR folks, release()
seems to only be required at garbage collection time. 
However, in the case of DBTags, we do indeed reset
state with release() and call it in most doEndTag()
methods.

> Is there any harm in clearing the body in the
> reset() method?  I'm not too
> familiar with the finer points of the Taglib
> specification.  I suppose I can
> just get the source for DBTags and put the hack in
> myself just to keep us
> going, but I was hoping not to have to do that.

The only harm is that it appears to be specifically
addressing a bug in WLS, rather than something
dictated by the spec.  Believe me, I use WLS 6 in
production too, so I know how frustrating WLS bugs can
be.

I think my preference would be to not add WLS-specific
workarounds.  It's pretty simple to add that code to
your local CVS copy.  If we find out that this is
something required by the spec, I'll be happy to
modify the source.  Otherwise I advise hounding your
WLS rep.  :)

> Any insight you can give me is greatly appreciated.
> 
> Thanks,
> --Loren
> 
> -----Original Message-----
> From: Morgan Delagrange [mailto:mdelagra@yahoo.com] 
> Sent: Tuesday, August 14, 2001 5:26 PM
> To: taglibs-user@jakarta.apache.org
> Subject: Re: DBTags in WebLogic 6.0
> 
> 
> Ouch, really really sounds like a Weblogic bug to
> me. 
> Even if the tags are being cached, there's no way
> that
> the tag should be retaining that information from
> invocation to invocation.  In fact, when the result
> set is empty, we return the SKIP_BODY constant.  :P
> 
> - Morgan
> 
> --- "Halvorson, Loren"
> <Loren.Halvorson@firepond.com>
> wrote:
> > I have found what I think to be a problem with the
> > DBTags ResultSet taglib
> > when used with WebLogic 6.0 SP2.  (I don't think
> > it's significant, but I am
> > using RowSets rather than ResultSets)
> > 
> > I have a single JSP with two rowset tags, the
> first
> > tag is fed a rowset with
> > several rows in it and works flawlessly, but the
> > second is fed a rowset
> > who's query did not return any rows, and the body
> of
> > the first tag is
> > erroneously written out for the second.  In
> > ResultSetTag.java the body
> > content seems to need to be cleared out somehow in
> > release() due to
> > WebLogic's recycling of the tag instances.
> > 
> > I wondered if doing something like the following
> > would fix it:
> > 
> >   public void release() {
> >     _statement = null;
> >     _rset = null;
> >     _shouldLoop = true;
> >     _name = null;
> >     _scope = null;
> >     _rowCount = 0;
> >     _stmtTag = null;
> >     try {
> >         getBodyContent().clear();
> >     } catch (Exception e) { }
> >   }
> > 
> 
> 
> =====
> Morgan Delagrange
> http://jakarta.apache.org/taglibs
> http://jakarta.apache.org/commons
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute
> with Yahoo! Messenger
> http://phonecard.yahoo.com/


=====
Morgan Delagrange
http://jakarta.apache.org/taglibs
http://jakarta.apache.org/commons

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Mime
View raw message