Blasius Lofi Dewanto wrote:
>
> Hi all,
>
> I just upgraded my Jonas from 2.0 to 2.2.7 and I
> found some inconsistencies:
>
> - With 2.0 I didn't have a problem with this code
> by an entity bean (CMP):
>
> ...
> public class EnrollmentBean implements EntityBean {
>
> // Object state
> public String subjectPK;
>
> // Just for get and set methods
> protected Subject subject;
>
> // Get the subject
> public Subject getSubject() {
> // Lazy load...
> try {
> if (subject != null) {
> return subject;
> }
> else {
> SubjectHome subjectHome =
> (SubjectHome)HomeInterfaceFactory.create(
> SubjectHome.class, SubjectHome.COMP_NAME);
> subject = subjectHome.findByPrimaryKey(new
> SubjectPK(subjectPK));
>
> return subject;
> }
> }
> catch (Exception ex) {
> throw new EJBException(res.getString("Invalid_Subject") + ex);
> }
> }
> ...
>
> And call this from my client:
>
> ...
> SubjectObject subject = (SubjectObject)enrollment.getSubject();
> ...
>
> With 2.2.7 the result of the subject is unpredictable!
> This means that the lazy load method does not work
> any longer. Why?
>
> - The genic let me compile a stateless session bean that has
> a parameter on the create method. This is actually forbidden by
> the EJB 1.1 Spec that says, you cannot have a parameter
> at the create method for a stateless session bean.
>
> I appriciate your help, especially for the lazy load problem,
> very much! I need an answer as soon as possible,
> because OpenUSS wants to switch into the production stage
> in 2 weeks. I have to know whether I should use JOnAS
> 2.0 or 2.2.7.
>
> Please answer directly to my email ([EMAIL PROTECTED])
> because I don't subscribe your mailing list.
>
> Thanx!
>
Hi,
It is true that GenIC doesn't verify the comformity of a bean to the
specification
but it is not new, it was already the case with JOnAs 2.0.
For the first problem I don't understand very well what you are doing
but your code is not conform to the specification,
In order to get a reference to a home object you must perform
a JNDI lookup
SubjectHome subjectHome =
(SubjectHome)initialContext.lookup(homename);
and not
> (SubjectHome)HomeInterfaceFactory.create(
> SubjectHome.class, SubjectHome.COMP_NAME);
I hope it helps
I think it is worth for you to use JOnAS 2.2.7 instead of 2.0.
Best regards,
--
Philippe
Philippe Coq Evidian Phone: (33) 04 76 29 78 49
Bull S.A - 1 rue de Provence - 38432 Echirolles Cedex France
Download our EJBServer at http://www.objectweb.org
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".