Package javax.transaction

Examples of javax.transaction.TransactionManager.commit()


    HeroClub hc = new HeroClub();
    hc.setName( "My hero club" );
    hc.getMembers().add( h );
    hc.getMembers().add( sh );
    em.persist( hc );
    transactionManager.commit();

    em.clear();

    transactionManager.begin();
    HeroClub lhc = em.find( HeroClub.class, hc.getName() );
View Full Code Here


    lhc.getMembers().clear();
    em.remove( lh );
    em.remove( lsh );
    em.remove( lhc );

    transactionManager.commit();

    em.close();

    dropSchemaAndDatabase( emf );
    emf.close();
View Full Code Here

    CommunityMember member = new CommunityMember( "Davide" );
    em.persist( member );

    Employee employee = new Employee( "Alex", "EMPLOYER" );
    em.persist( employee );
    tm.commit();

    em.clear();

    tm.begin();
    CommunityMember lh = em.find( CommunityMember.class, member.name );
View Full Code Here

    assertThat( lsh ).isInstanceOf( Employee.class );
    assertThat( ((Employee) employee).employer ).isEqualTo( employee.employer );

    em.remove( lh );
    em.remove( lsh );
    tm.commit();
    em.close();
    dropSchemaAndDatabase( emf );
    emf.close();
  }
View Full Code Here

        TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class);
        transactionManager.begin();
        try {
            testBusinessRemoteInterface(inTxExpectedLifecycle);
        } finally {
            transactionManager.commit();
        }
    }

    protected void testBusinessLocalInterface(List expectedLifecycle) throws Exception {
View Full Code Here

        TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class);
        transactionManager.begin();
        try {
            testBusinessLocalInterface(inTxExpectedLifecycle);
        } finally {
            transactionManager.commit();
        }
    }

    protected void testBusinessRemoteInterface(List expectedLifecycle) throws Exception {
        WidgetBean.lifecycle.clear();
View Full Code Here

        try {
            verifyManagedConnections(managedDS);
            verifyUnmanagedConnections(unmanagedDS);
        } finally {
            // commit the transaction
            transactionManager.commit();
        }
    }

    private void verifyManagedConnections(DataSource dataSource) throws SQLException {
        List<Connection> managedConnections = new ArrayList<Connection>();
View Full Code Here

        TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class);
        transactionManager.begin();
        try {
            testBusinessRemoteInterface(inTxExpectedLifecycle);
        } finally {
            transactionManager.commit();
        }
    }

    protected void testBusinessLocalInterface(List expectedLifecycle) throws Exception {
View Full Code Here

        TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class);
        transactionManager.begin();
        try {
            testBusinessLocalInterface(inTxExpectedLifecycle);
        } finally {
            transactionManager.commit();
        }
    }

    public void testBusinessLocalBeanInterfaceInTx() throws Exception {
         List localbeanExpectedLifecycle = new ArrayList();
View Full Code Here

        TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class);
        transactionManager.begin();
        try {
            testBusinessLocalBeanInterface(localbeanExpectedLifecycle);
        } finally {
            transactionManager.commit();
        }
    }

    protected void testBusinessRemoteInterface(List expectedLifecycle) throws Exception {
        WidgetBean.lifecycle.clear();
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.