cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Rassy <ra...@math.TU-Berlin.DE>
Subject Re: setup() called twice in one request
Date Fri, 20 Jan 2006 13:13:01 GMT
Hello,

On Thursday 19 January 2006 23:43, Joerg Heinicke wrote:
> On 19.01.2006 19:01, Tilman Rassy wrote:
> > we discovered that the setup() method of a custom generator is sometimes
> > called twice in one request.
>
> Are you sure that it is only one request. For example using the Acrobat
> Reader in IE results in two requests.

I'm quite sure that it is the same request and the the same generator instance 
- we have very detailed logging. Here is an exceprt from the logs:

------------ log except start -----------

// setup method starts

sitemap.log 5663:  DEBUG   (2006-01-18) 20:39.37:763   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: setup 1/3: Started

sitemap.log 5664:  DEBUG   (2006-01-18) 20:39.37:763   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: setup 2/3: type = 15, id = 16, useMode = 0, refId = -1, 
fromDocType = -1

// some nonrelevant messages left out here

sitemap.log 5669:  DEBUG   (2006-01-18) 20:39.37:766   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: setup 3/3: Done. this.document = XslStylesheetDocument#3
(15,16,0)

// setup method has returned

// some nonrelevant messages left out here

// getKey Method starts

sitemap.log 5675:  DEBUG   (2006-01-18) 20:39.37:773   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getKey 1/2

sitemap.log 5676:  DEBUG   (2006-01-18) 20:39.37:780   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getKey 2/2: key = 15-16-!-!-0

// getKey Method has returned

// getValidity method starts

sitemap.log 5678:  DEBUG   (2006-01-18) 20:39.37:782   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getValidity 1/2

sitemap.log 5679:  DEBUG   (2006-01-18) 20:39.37:788   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getValidity 2/2: lastModified = 1137439974166

// getValidity method has returned

// second getValidity call starts

sitemap.log 5682:  DEBUG   (2006-01-18) 20:39.37:789   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getValidity 1/2

sitemap.log 5683:  DEBUG   (2006-01-18) 20:39.37:793   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getValidity 2/2: lastModified = 1137439974166

// second getValidity call has returned

// second setup call starts

sitemap.log 5686:  DEBUG   (2006-01-18) 20:39.37:794   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: setup 1/3: Started

sitemap.log 5687:  DEBUG   (2006-01-18) 20:39.37:795   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: setup 2/3: type = 15, id = 16, useMode = 0, refId = -1, 
fromDocType = -1

// some nonrelevant messages left out here

sitemap.log 5692:  DEBUG   (2006-01-18) 20:39.37:797   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: setup 3/3: Done. this.document = XslStylesheetDocument#4
(2,16,0)

// second setup call has returned

sitemap.log 5698:  DEBUG   (2006-01-18) 20:39.37:805   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getKey 1/2

sitemap.log 5699:  DEBUG   (2006-01-18) 20:39.37:806   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getKey 2/2: key = 15-16-!-!-0

sitemap.log 5701:  DEBUG   (2006-01-18) 20:39.37:807   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getValidity 1/2

sitemap.log 5702:  DEBUG   (2006-01-18) 20:39.37:814   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: getValidity 2/2: lastModified = 1137439974166

// recycle starts

sitemap.log 5705:  DEBUG   (2006-01-18) 20:39.37:815   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: recycle 1/2

// some nonrelevant messages left out here

sitemap.log 5710:  DEBUG   (2006-01-18) 20:39.37:822   [sitemap] (/cocoon/
protected/admin/status/service/overview) Thread-12/AbstractJapsGenerator: 
DocumentGenerator#2: recycle 2/2

// recycle has returned

----------- log excerpt end ---------

"DocumentGenerator#2" means "DocumentGenerator instance with instance id 2". 
The instance id is a unique number attached to each instance, so you can see 
that both setup() calls are from the same generator instance. Also, the URI 
and the thread are the same.

Another striking fact is that between the two setup calls, no recycle is 
called. 

> > in fact, it seem to happens only if the generator
> > is applied to a document that is an XSL stylesheet.
>
> What does this mean?

The purpose of the generator is to get documents from a database, create XML 
representations of them and send them to the pipeline. The documents are of 
various types. One of the types is "XSL stylesheet". Only with this type the 
problem occurs (as far as we know).

Any more ideas/help are welcome,
best regards

Tilman

Mime
View raw message