deleted  Session session = getSession();
                Transaction t = session.beginTransaction();
                int hehehe=0;
                try {
                    session.save(object);
                    t.commit();
                } catch (Exception e) {
                    if (t != null) {
                        t.rollback();
                    }
                    throw e;
                } finally {
                    if (session != null && session.isOpen()) {
                        session.close();
                    }
                }
deleted   t.commit();