quality@glassfish.java.net

Re: weird problem with items from entity

From: Felipe Gaucho <fgaucho_at_gmail.com>
Date: Wed, 18 Nov 2009 22:51:26 +0100

This setItemList is a "normal" setter?

On 18.11.2009, at 22:45, Vladimir Perlov <vladperl_at_hotmail.com> wrote:

> 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. Try
> it now.