合併將更新Name到Manik或Ankit?合併將更新新的會話對象更新?
Student s1 = null;
s1 = (Student)session1.get(Student.class, new Integer(101));
session1.close();
s1.setName("Manik");
Session session2 = factory.openSession();
Student s2 = null;
Object o1 = session2.get(Student.class, new Integer(101));
s2 = (Student)o1;
s2.setName("Ankit");
Transaction tx=session2.beginTransaction();
session2.merge(s1);