public
static
void
main(String[] args) {
Session s1 = HibernateUtils.openSession();
s1.beginTransaction();
Customer c1 = (Customer) s1.get(Customer.
class
,
1
);
System.out.println(c1.getName());
s1.getTransaction().commit();
s1.close();
Session s2 = HibernateUtils.openSession();
s2.beginTransaction();
Customer c2 = (Customer) s2.get(Customer.
class
,
1
);
System.out.println(c2.getName());
}