users@glassfish.java.net

Re: MDB | _at_PostConstruct called on every message

From: Cheng Fang <cheng.fang_at_oracle.com>
Date: Wed, 07 Sep 2011 19:53:02 -0400

PostConstruct method is invoked when bean instances are created. It
should not be invoked when servicing incoming messages. But it's
possible your MDB is configured in a way that each incoming message
causes a new instance to be created.

-cheng

On 9/7/11 7:35 PM, Jackson, Brian R. wrote:
> I'm using Glassfish 2.1.1 and I've just profiled my app and see that
> my @PostConstruct method appears to be called on every message rather
> than when the MDB is created in the bean pool. Is this the expected
> behavior? Have I configured or coded something incorrectly?