Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

findByPK creates too many instances

843829Oct 28 2003 — edited Oct 29 2003
Hi 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2003
Added on Oct 28 2003
5 comments
180 views