I'm planing to use this StatelessSession interface in hibernate. But do not know what data aliasing effect as explained here
consider data like
table parent
id | name
---------
1 | 'foo'
table child
id | parent_id
--------------
1 | 1
2 | 1
and a query
session.query("from child").list();
then the following will fail for StatelessSession session
but not for Session session
childs.get(0).getParent().setName("bar");
assertEqual("bar", childs.get(1).getParent().getName());
Update:
StatelessSession does not "remember" the objects it loaded so while dehydration the second child it doesn't know it already created the parent object it refers to and will create another parent object which has the same values but not the same references.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With