Hello,

I have seen this issue a couple of times. In every case it has been because 
sightly would initialize the same class twice, first using the adaptTo  and 
then the java Pojo provider. This was caused in every case by an error in the 
Post Construct method of the Sling Model class, which meant the adaptTo would 
return null and sightly would just keep trying different use providers.

Is this your scenario maybe?

Greetings.

Santiago García Pimentel| Sr Software Engineer
Netcentric Ibérica SLU
M: +34687915463
santiago.pimen...@netcentric.biz <mailto:firstname.lastn...@netcentric.biz> | 
www.netcentric.biz <http://www.netcentric.biz/>
> On Feb 2, 2017, at 3:08 AM, lancedolan <lance.do...@gmail.com> wrote:
> 
> Through my years in Adobe CQ and AEM, I've noticed that LOG files from
> components that I write always render twice per page request. Today I was
> debugging my code in Sling 8 and noticed that My debugger was kicked open
> twice each time I requested a page instead of once.
> 
> What's the deal with this? It seems really common, you guys must all be
> familiar with it also?
> 
> It's dangerous because all components logic must be idempotent (imagine
> posting duplicate records to a database). And then obviously, it's bad for
> performance to do things twice unnecessarily.  
> 
> I've seen this so often on so many projects that I'm not really tempted to
> offer any steps to reproduce, you guys must be seeing this also right?
> 
> NOTE: The component is NOT included on the page more than once. This
> behavior will occur when a component is included only once. 
> 
> 
> 
> --
> View this message in context: 
> http://apache-sling.73963.n3.nabble.com/Components-each-process-twice-tp4070042.html
> Sent from the Sling - Users mailing list archive at Nabble.com.

Reply via email to