Hello everybody,

As per the EJB specs when ever a Bean instance is not associated with any
EJB Object or if it gets passivated, its bean instance goes into the
Instance Free Pool.  And each instance is assigned to EJB Object as per
requirement , by the container.    If new EJB Object is created, the old
values(I call it dirty data ! ) of bean instance are assigned or carried
onto the next  EJB Object, this seems to be a problem !!

=========================================================================
For details see below scenario :

Consider a Entity Bean  "EmployeeBean" with CMP fields :
empno(NOT NULL), empName(NULL allowed), salary(NULL allowed);
Have two create methods :
create(empno,empName,salary);   create(empno);

Data in table :  (100, myname,1000);

SCENARIO FIRST :
After the deployement, I run my client for the first time which does :
1.  findByPrimaryKey(new EmployeePK(100) )  on EmployeeBean.  // works fine
2.  create(200, "aaaa", 2000 );   // Works fine

Now data in table : (100,myname,2000) , (200,"aaaa", 2000);

SCENARIO SECOND :
Restart the server , and run the client SECOND time after making the client
to sleep for some secs :
1.  finByPrimaryKey(new EmployeePK(200)) ;    // works fine
2.  client thread sleep();
2. The above remote objects gets passivated.
3. create(300) ;   works fine,  BUT

the data in the table is :
(100,myname,2000) , (200,"aaaa", 2000), (300,"aaaa", 2000);
instead of :
(100,myname,2000) , (200,"aaaa", 2000), (300,NULL,NULL);

Hence, the values of a bean from the pool when assigned it doesnt get
initilized to zero/NULL , instead its previous values are carried on to next
assigned remote object, which lead to in-correct data entry into fields
which are not assigned by the user, when it has to be NULLs in database.

Any comments on this, will help us in understanding and development of
further applications.

(Used Weblogic 4.51, On Oracle8, On NT !!)

Thank you,
Regards.

Ganapur Srinivas.

Cognizant Technology Solutions India Ltd.
Ground Floor,
Deepak Complex,
National Games Road,
Opp.Pune Golf Course,
Yerwada.
Pune 411006.India.
Tel. :6691960.Extn-2277.
[EMAIL PROTECTED]

===========================================================================
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".

Reply via email to