The easy answer is no: you cannot depend on bean instantiation,
ejbActivate and ejbPassivate, for these behaviors vary amongst vendors just
like void final() and GC vary between JVMs.
If you want to cache info corresponding to a pk, why not put it as a
transient member to the pk class itself? I know this sounds unorthodox, but
depending on exactly what you have in mind, this may work; I've used pk
classes to contain extraneous info before and it works.
Gene Chuang
Kiko.com
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Daniel Caune
Sent: Tuesday, January 23, 2001 1:11 AM
To: [EMAIL PROTECTED]
Subject: Entity bean
Dear all,
Does the instance of an entity bean, managed by the container, can be shared
belong its life from the ejbCreate/ejbActivate until the
ejbPassivate/ejbRemove between two primary keys ?
Is this sequence possible ?
ejbCreate (primaryKey1) => instance1 is used
ejbLoad (primaryKey1) => instance1 is used
myBeanMethod (primaryKey1) => instance1 is used
ejbStore (primaryKey1) => instance1 is used
ejbCreate (primaryKey2) => instance1 is used
ejbLoad (primaryKey2) => instance1 is used
myBeanMethod (primaryKey2) => instance1 is used
ejbStore (primaryKey2) => instance1 is used
Or must these sequences always be used by the container ?
ejbCreate (primaryKey1) => instance1 is used
ejbLoad (primaryKey1) => instance1 is used
myBeanMethod (primaryKey1) => instance1 is used
ejbStore (primaryKey1) => instance1 is used
ejbCreate (primaryKey2) => instance2 is used
ejbLoad (primaryKey2) => instance2 is used
myBeanMethod (primaryKey2) => instance2 is used
ejbStore (primaryKey2) => instance2 is used
ejbCreate (primaryKey1) => instance1 is used
ejbLoad (primaryKey1) => instance1 is used
myBeanMethod (primaryKey1) => instance1 is used
ejbStore (primaryKey1) => instance1 is used
ejbPassivate (primaryKey1) => instance1 is used
ejbCreate (primaryKey2) => instance1 is used
ejbLoad (primaryKey2) => instance1 is used
myBeanMethod (primaryKey2) => instance1 is used
ejbStore (primaryKey2) => instance1 is used
ejbActivate (primaryKey1) => instance2 is used
ejbLoad (primaryKey1) => instance2 is used
myBeanMethod (primaryKey1) => instance2 is used
ejbStore (primaryKey1) => instance2 is used
The main question is : can I cache some internal data, corresponding to a
primary key, into member of the current instance of my entity bean between
ejbCreate/ejbActivate and the ejbPassivate/ejbRemove or not ?
Regards,
Tedy
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".