I refresh an entity with locktype PESSIMISTIC_WRITE.
Tab1 tab1 = em.find(Tab1.class, id, LockModeType.PESSIMISTIC_WRITE);
em.refresh(tab1, LockModeType.PESSIMISTIC_WRITE);
I have 3 tables:
public class Tab1{int id;String name;Tab2 tab2;}
public class Tab2{int id;String name;Tab3 tab3;}
public class Tab3{int id;String name;}
Which data or tables will be locked (see example)?
1) Only the row with id in Tab1?
2) Entire table Tab1?
3) Entire table Tab1 and Tab2
4) Entire table Tab1,Tab2 and Tab3,because there are reference to tab2 and tab3?