quality@glassfish.java.net

weird problem with items from entity

From: Vladimir Perlov <vladperl_at_hotmail.com>
Date: Wed, 18 Nov 2009 21:45:07 +0000

Hi everybody,
I have very strange issue that appears in all the last promoted builds of Glassfish v3.
At least on Glassfish Prelude I know my code is working fine.
I really don't know what part of the system responsible for it and beside it could be mayor bug that need to be fixed quickly.
At least in my application it's serious issue.

Description the issue:

   public Order saveOrder(Order order) {
      List<OrderItem> list = order.getItemList();
      order.setItemList(null);

Let's say the order's item list contains two items before running the method shown above.
"list" variable after assignment obviously also has two elements inside of the list. (first row in the method)
Then after statement "order.setItemList(null);" executed the variable list has suddenly only one item instead of expected two.

For more information I could say only that "Order" class is entity and the method "saveOrder" is located inside stateless enterprise java bean:

@Stateless
public class EntityController implements EntityControllerLocal {
--------------------------------------------------------------------------------

Of course the following work around working find but still I believe it should be fixed as soon as possible:

      List<OrderItem> list = new ArrayList<OrderItem>();
      list.addAll(order.getItemList());
      order.setItemList(null);


I don't have much time to prepare test case but If somebody need it I can send the whole application and even real DB to make it alive. There is no any sensitive data inside my DB.

Thank you,
Vladimir
                                               
_________________________________________________________________
Bing brings you maps, menus, and reviews organized in one place.
http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1