Bugs item #742197, was opened at 2003-05-23 18:16
Message generated for change (Comment added) made by scoy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=742197&group_id=22866

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Federico (nabuccodonosor)
Assigned to: Nobody/Anonymous (nobody)
Summary: getEJBLocalObject()  bug

Initial Comment:
- Tested OS:
    Win XP - service pack 1
    SuSe Linux 8.0 

- VM Sun 1.4.1_1

- SOFTWARE:
    enterprise-server : jboss-3.2.1_tomcat-4.1.24 (on Win 
XP - service pack 1 and SuSe Linux 8.0 )

    database : mysql 4.0.12 (on Suse Linux 8.0)

    driver for db : 3.0.6 mysql-connector


I got no exception stack, no error on the console, but 
mismatched fields of a row comes out, because of the 
getEJBLocalObject() to fetch a primary key of an auto 
incremental key field after the bean has been passivated.
Before the time out everything is ok, after the time out I 
got wrong datas.

The test I did to reproduce the bug has been a very 
simple test:

A single table "test" on db with 3 
fields "id_test" , "s_des_1" , "s_des_2"

An entity bean related to the table with no definition 
of "id_test" cmp field, because an auto incremental key 
field

In the entity bean i did the getId_test business method 
to fetch the primary key in this way 

public int getId_test()
 {
   final TestLocal test = (TestLocal)
context.getEJBLocalObject();
   return ((Integer)test.getPrimaryKey()).intValue();
 }

Then I created a stateless session bean that call a 
findAll() method on the local home interface of the entity 
to fetch the table rows and then copy the collection 
result in a collection of javabeans.

The javabeans has the same three variables 

int    id_test
String s_des_1
String s_des_2

When in the session bean I set the id_test variable, I 
call on the local interface the getId_test method of the 
entity bean.


I call the session bean method from a servlet that pass 
the collection to a jsp that show the table's rows on the 
browser.

All is ok until i wait the time out period without do calls.

After timeout period the rows result corrupt: right 
descrition (fetched by abstract method) but wrong 
id_test (fetched by getEJBLocalObject().getPrimaryKey
()).

Not always the problem comes out but during my test it 
is happened again.


I'm going to attach to this mail a .zip file with the .jar for 
the EJBs (with sources) and a .war file for the servlet 
and jsp (with sources).

Furthermore in the .zip file I put two .sql files to 
generate table and test datas and a .doc file to describe 
different results.

The last thing to say is that if I bypass the getId_test() 
call by calling directly the getPrimaryKey() on the 
Loacal interface instead of calling getId_test() method, 
everything is ok.

This could be a sneaky problem, that people could not 
see.

I hope to receive a reply from you.

Thanks a lot!


Federico


P.S. I forgot that with the jboss-3.2.0RC2_tomcat.4.1.18 
is always ok.

----------------------------------------------------------------------

Comment By: Stephen Coy (scoy)
Date: 2003-07-19 00:46

Message:
Logged In: YES 
user_id=463096

There is now a test case in Branch_3_2 that demonstrates this 
problem.

./build.sh -Dtest=cmp2/passivation test

in the the testsuite directory.



----------------------------------------------------------------------

Comment By: Stephen Coy (scoy)
Date: 2003-07-18 01:33

Message:
Logged In: YES 
user_id=463096

I've added a test to the jboss test suite that demonstrates this 
which I will check in sometime during the next day or so.

In essence, after an entity bean is passivated, and then activated 
again:

o.getPrimaryKey() != o.ctx.getEJBLocalObject().getPrimaryKey()

It was (too) easy to replicate.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=742197&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to