Package net.sf.hibernate

Examples of net.sf.hibernate.Transaction.commit()


        txn = session.beginTransaction();
        repository.setAttribute(0, "test.x", "xvalue0");
        repository.setAttribute(0, "test.y", "yvalue0");
        repository.setAttribute(10000, "test.y", "foo");
        txn.commit();

        txn = session.beginTransaction();
        assertEquals("wrong attribute value", "xvalue0", repository.getAttribute(0, "test.x"));
        assertEquals("wrong attribute value", "yvalue0", repository.getAttribute(0, "test.y"));
        assertEquals("wrong attribute value", "foo", repository.getAttribute(10000, "test.y"));
View Full Code Here


        assertEquals("wrong attribute value", "xvalue0", repository.getAttribute(0, "test.x"));
        assertEquals("wrong attribute value", "yvalue0", repository.getAttribute(0, "test.y"));
        assertEquals("wrong attribute value", "foo", repository.getAttribute(10000, "test.y"));

        repository.delete(10000, "test.y");
        txn.commit();

        txn = session.beginTransaction();
        assertNull("wrong attribute value", repository.getAttribute(10000, "test.y"));

        Map attributes = repository.getAttributes(0, "test.");
View Full Code Here

        assertEquals("wrong attribute value", "xvalue0", attributes.get("x"));
        assertEquals("wrong attribute value", "yvalue0", attributes.get("y"));

        // modification
        repository.setAttribute(0, "test.x", "another value");
        txn.commit();

        txn = session.beginTransaction();
        assertEquals("wrong attribute value", "another value", repository.getAttribute(0, "test.x"));;

        repository.delete(0, "test.x");
View Full Code Here

        txn = session.beginTransaction();
        assertEquals("wrong attribute value", "another value", repository.getAttribute(0, "test.x"));;

        repository.delete(0, "test.x");
        repository.delete(0, "test.y");
        txn.commit();

        txn = session.beginTransaction();
        assertNull("wrong attribute value", repository.getAttribute(0, "test.x"));
        assertNull("wrong attribute value", repository.getAttribute(0, "test.y"));
        txn.commit();
View Full Code Here

        txn.commit();

        txn = session.beginTransaction();
        assertNull("wrong attribute value", repository.getAttribute(0, "test.x"));
        assertNull("wrong attribute value", repository.getAttribute(0, "test.y"));
        txn.commit();
    }

}
View Full Code Here

                  "CONSTRAINT hresperformsrole_pkey PRIMARY KEY (hresid, rolename)," +
                  "CONSTRAINT ResourceFK FOREIGN KEY (hresid) REFERENCES resserposid (id) ON UPDATE CASCADE ON DELETE CASCADE," +
                  "CONSTRAINT RoleFK FOREIGN KEY (rolename) REFERENCES role (rolename) ON UPDATE CASCADE ON DELETE CASCADE" +
                ");"
            );
            tx.commit();
        } catch (Exception e) {
            tx.rollback();
        }
    }
}
View Full Code Here

            } else if (SAVE_OPERATION == operation) {
                session.save(obj);
            }
            session.flush();
            session.evict(obj);
            tx.commit();
            session.close();
        } catch (HibernateException e) {
            throw new YPersistenceException("Hibernate problem: " + e.getMessage(), e);
        }
    }
View Full Code Here

            ActionForward forward = doExecute(mapping, form, request, response);
            Object object = request.getAttribute(TARGET_OBJECT);
            if (object != null) {
                beforeObjectCommit(object, session, mapping, form, request, response);
            }
            transaction.commit();
            afterObjectCommit(mapping, form, request, response);
            return forward;
        } catch (AuthorizationException e) {
            request.setAttribute("exception", e);
            return mapping.findForward("security/notAuthorized");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.