]
vinay kumar updated HHH-5571:
-----------------------------
Issue Type: New Feature (was: Bug)
Hibernate loading the wrong bean in collection from the session cache
(very unusual case), it occurs only for specific set of data.
-----------------------------------------------------------------------------------------------------------------------------------
Key: HHH-5571
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5571
Project: Hibernate Core
Issue Type: New Feature
Environment: Ehcache(ehcache-core-2.0.0.jar), Jdk 1.6.0_12
Reporter: vinay kumar
Attachments: HibernateBug sources.rar
I have a customer order from a retail catalog project. The central class is the
Order. Associated with it are the Customer and Provider Company, customer making the
purchase and the Payment. A Payment is one of three kinds: Cash, Check, or Credit. The
order contains OrderDetails (line items), each with its associated Item.
so each customer has set of orders in turn each order has one of the three kinds of
payment. When ever i load two customers in the same transaction and i read the orders of
the customers, one of the order is misplaced into other customer (it very unusual and
happens only for specific set of data).
Test Case : I have two customers US customer and Italy Customer with set of orders. when
i try to load the two customers in the same transaction and check the orders so i get the
following values. Here i don't change any values, the session is readOnly. Bean
hashcode and equals methods are manually overridden.
Italy Customer.getOrders
{start t1}
1) Order : [Customer Name = Italy Customer, Company Product : Apple Power Chord] Payment
: Cheque = 100 €
2) Order : [Customer Name = Italy Customer, Company Product : Apple Mac Pro] Payment :
Cheque = 2000 €
3) Order : [Customer Name = Italy Customer, Company Product : Microsoft Usb] Payment :
Cheque = 200 €
4) Order : [Customer Name = Italy Customer, Company Product : Apple Mac Air] Payment :
Cheque = 1500 €
5) Order : [Customer Name = Italy Customer, Company Product : Microsoft Keyboard] Payment
: Credit = 73.7153€
6) Order : [Customer Name = Italy Customer, Company Product : Apple MacBook ] Payment :
Cheque = 1000 €
7) Order : [Customer Name = Italy Customer, Company Product : Dell Mouse] Payment :
Credit = 6.90361€
8) Order : [Customer Name = Italy Customer, Company Product : Apple TV] Payment : Cash =
10000€
9) Order : [Customer Name = Italy Customer, Company Product : Siemens HeadPhone] Payment
: Credit = 100.0€
{end t1}
US Customer.getOrders
{start t2}
1) Order : [Customer Name = U.S Customer, Company Product : Dell Mouse] Payment : Credit
= 6.69889$
2) Order : [Customer Name = U.S Customer, Company Product : Microsoft Keyboard] Payment :
Credit = 73.7144$
3) Order : [Customer Name = U.S Customer, Company Product : Siemens HeadPhone] Payment :
Credit = 164.0$
4) Order : [Customer Name = U.S Customer, Company Product : Apple TV] Payment : Cash =
10000$
5) Order : [Customer Name = U.S Customer, Company Product : Microsoft Usb] Payment :
Cheque = 200 $
6) Order : [Customer Name = U.S Customer, Company Product : Apple MacBook ] Payment :
Cheque = 1000 $
7) Order : [Customer Name = U.S Customer, Company Product : Apple Power Chord] Payment :
Cheque = 100 $
8) Order : [Customer Name = U.S Customer, Company Product : Apple Mac Pro] Payment :
Cheque = 2000 $
9) Order : [Customer Name = U.S Customer, Company Product : Apple Mac Air] Payment :
Cheque = 1500 $
Italy Customer.getOrders
1) Order : [Customer Name = Italy Customer, Company Product : Apple Power Chord] Payment
: Cheque = 100 €
2) Order : [Customer Name = Italy Customer, Company Product : Apple Mac Pro] Payment :
Cheque = 2000 €
3) Order : [Customer Name = Italy Customer, Company Product : Microsoft Usb] Payment :
Cheque = 200 €
4) Order : [Customer Name = Italy Customer, Company Product : Apple Mac Air] Payment :
Cheque = 1500 €
5) Order : [Customer Name = Italy Customer, Company Product : Microsoft Keyboard] Payment
: Credit = 73.7153€
6) Order : [Customer Name = Italy Customer, Company Product : Apple MacBook ] Payment :
Cheque = 1000 €
7) Order : [Customer Name = U.S Customer, Company Product : Apple TV] Payment : Cash =
10000$
8) Order : [Customer Name = Italy Customer, Company Product : Apple TV] Payment : Cash =
10000€
9) Order : [Customer Name = Italy Customer, Company Product : Siemens HeadPhone] Payment
: Credit = 100.0€
{ end t2}
where t1,2 are two different transactions. When im trying to load the italy customer in
t2 the order 'Dell mouse' is replaced by US customer's 'Apple TV'.
Observations :
1) if i try to separate the transactions for each customer, the problem doesn't
exist.
2) if i try to evict the same bean and try to load again , still the problem
persists.(italy customer here)
3) if i try to evict the other bean and try to load, the problem doesnt exist.(US
customer here)
4) if i try to clear the session and load again the orders all the time, the problem
doesnt exist.
5) if i try to set the CacheMode to IGNORE still the problem persists.
6) This problem only exists for certain data values. In test case i have Italy
Customer(cust_id = 5799847) and US Customer (cust_id = 5799736). If i change one of the id
of the customer the problem doesnt exist. if i increase and decrease the both values by
'n' the problem persist again.(very strange).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: