findByPK creates too many instances
843829Oct 28 2003 — edited Oct 29 2003Hi all,
When using JBoss (I don't know other servers behavior) the findByPrimaryKey method creates a "home instance".
I think that JBoss need a "home instance" for finder methods and it could create only one to do that, but, in fact, it creates a new instance for each call and doesn't reuse it.
For example:
Integer pk = new Integer(1);
First findByPrimaryKey(pk): 2 instances created (Home instance and Bean instance)
Secound findByPrimaryKey(pk): 1 instance created (Home instance)
Third findByPrimaryKey(pk): 1 instance created (Home instance)
The ejbLoad method is called only on the first call (it's my configuration).
Any idea?
Thank you,
Denis.