Package org.qi4j.api.unitofwork

Examples of org.qi4j.api.unitofwork.UnitOfWork.discard()


            {
                UnitOfWork uow = module.currentUnitOfWork();
                if( uow.isOpen() )
                {
                    System.err.println( "UnitOfWork not cleaned up:" + uow.usecase().name() );
                    uow.discard();
                }
                else
                {
                    throw new InternalError( "I have seen a case where a UoW is on the stack, but not opened. First is: " + uow
                        .usecase()
View Full Code Here


            assertThat( "namedAssociation has correct 'bar' value",
                        instance.namedAssociation().get( "bar" ),
                        equalTo( instance ) );

            unitOfWork.discard();
        }
        finally
        {
            unitOfWork.discard();
        }
View Full Code Here

            unitOfWork.discard();
        }
        finally
        {
            unitOfWork.discard();
        }
    }

    @Test
    public void whenRemovedEntityThenCannotFindEntity()
View Full Code Here

        {
            // Ok!
        }
        finally
        {
            unitOfWork.discard();
        }
    }

    @Test
    public void givenEntityIsNotModifiedWhenUnitOfWorkCompletesThenDontStoreState()
View Full Code Here

        UnitOfWork unitOfWork = module.newUnitOfWork();
        TestEntity testEntity = unitOfWork.newEntity( TestEntity.class );

        api.moduleOf( testEntity );

        unitOfWork.discard();

        api.moduleOf( module.newValue( TestValue.class ) );

        api.moduleOf( module.newTransient( TestTransient.class ) );
View Full Code Here

                System.err.println( "ERROR: Unable to find pretext!" );
                exitStatus = -1;
            } else {
                System.out.println( "SUCCESS: Found Pretext with reason: " + pretext.reason().get() );
            }
            uow.discard();

        } finally {
            deleteData( application.findModule( "infra", "persistence" ) );
        }
View Full Code Here

                    connection.commit();
                } finally {
                    SQLUtil.closeQuietly( stmt );
                }
            } finally {
                uow.discard();
            }
        }

        // Indexing Data
        {
View Full Code Here

                } finally {
                    SQLUtil.closeQuietly( stmt );
                    SQLUtil.closeQuietly( connection );
                }
            } finally {
                uow.discard();
            }
        }
    }

}
View Full Code Here

            unitOfWork.complete();
        }
        finally
        {
            unitOfWork.discard();
        }

        UnitOfWork uow = module.newUnitOfWork();
        try
        {
View Full Code Here

                .getAssociationByName( "typeOfItem" )
                .type() );
        }
        finally
        {
            uow.discard();
        }
    }

    interface Item
        extends EntityComposite
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.