When I call a ejb3 method and this return a big collection (> 1000 items), in 
the moment which of pass the collection over net, some elements have values 
changes (sometimes :-( ). Very strange. See:



  | @Stateless
  | @Remote(MakeListOfBigDecimal.class)
  | public class MakeListOfBigDecimalBean {
  |     
  |     public List makeList(){
  |         
  |         List list = new ArrayList(12020);
  |         
  |         for (int i = 0; i < 12020; i++) {
  |             
  |             BigDecimal anyValue = null;
  |             if (i % 2 == 0){
  |                 anyValue = new BigDecimal("1.25");
  |             }else{
  |                 anyValue = new BigDecimal("2.13");
  |             }
  |             
  |             anyValue = anyValue.setScale(2, BigDecimal.ROUND_HALF_EVEN);
  |             list.add(anyValue);
  |         }
  |         
  |         
  |         BigDecimal sum = BigDecimal.ZERO;
  |         sum = sum.setScale(2, BigDecimal.ROUND_HALF_EVEN);
  |         
  |         for (Iterator iter = list.iterator(); iter.hasNext();) {
  |             BigDecimal bd = (BigDecimal) iter.next();
  |             sum = sum.add(bd);
  |         }
  |             
  |         System.out.println("SUM INSIDE MakeListOfBigDecimalBean: " + sum);
  |         
  |         
  |         return list;
  |         
  |     }
  | 
  | }
  | 


  | @Stateless
  | @Remote(ReadAndSumBigDecimalList.class)
  | public class ReadAndSumBigDecimalListBean {
  | 
  |     @EJB
  |     private MakeListOfBigDecimal makeListOfBigDecimal;
  |     
  |     public void doSumAfterRemoteCall(){
  |         
  |         List list = makeListOfBigDecimal.makeList();
  |         
  |         BigDecimal sum = BigDecimal.ZERO;
  |         sum = sum.setScale(2, BigDecimal.ROUND_HALF_EVEN);
  |         
  |         for (Iterator iter = list.iterator(); iter.hasNext();) {
  |             BigDecimal bd = (BigDecimal) iter.next();
  |             sum = sum.add(bd);
  |         }
  |             
  |         System.out.println("SUM INSIDE ReadAndSumBigDecimalListBean: " + 
sum);
  | 
  |         
  |     }
  |     
  | }
  | 

The output after 4 calls:
SUM INSIDE MakeListOfBigDecimalBean: 20313.80
SUM INSIDE ReadAndSumBigDecimalListBean: 20312.04
SUM INSIDE MakeListOfBigDecimalBean: 20313.80
SUM INSIDE ReadAndSumBigDecimalListBean: 20313.80
SUM INSIDE MakeListOfBigDecimalBean: 20313.80
SUM INSIDE ReadAndSumBigDecimalListBean: 20312.04
SUM INSIDE MakeListOfBigDecimalBean: 20313.80
SUM INSIDE ReadAndSumBigDecimalListBean: 20314.68


If I change @Remote and put @Local, all works fine..

My JBoss version is - 4.0.4.CR2

Glauber






View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3938979#3938979

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3938979


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to