Package org.qi4j.api.unitofwork

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


            uow.complete();
            fail( "Validation did not occur" );
        }
        finally
        {
            uow.discard();
        }
    }

    //    @Concerns( TestValidatableConcern.class )
View Full Code Here


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

    @Test
    public void givenValueWithAssociationsWhenNewUoWThenCanRead() throws UnitOfWorkCompletionException
View Full Code Here

            Assert.assertEquals( associationValue.some().get(), newAssociationValue.some().get() );
        }
        finally
        {
            unitOfWork.discard();
        }

        try
        {
            System.out.println( associationValue.toString() );
View Full Code Here

                        }
                        else
                        {
                            // GET requests
                            logger.debug( "  ### DISCARD " + uow + "   ### MODULE: " + qi4jModule );
                            uow.discard();
                        }
                    }
                    catch( ConcurrentEntityModificationException e )
                    {
                        logger.error( "  ### DISCARD " + uow + "   ### MODULE: " + qi4jModule );
View Full Code Here

                        }
                    }
                    catch( ConcurrentEntityModificationException e )
                    {
                        logger.error( "  ### DISCARD " + uow + "   ### MODULE: " + qi4jModule );
                        uow.discard();
                        e.printStackTrace();
                    }
                    catch( UnitOfWorkCompletionException e )
                    {
                        logger.error( "  ### DISCARD " + uow + "   ### MODULE: " + qi4jModule );
View Full Code Here

                        e.printStackTrace();
                    }
                    catch( UnitOfWorkCompletionException e )
                    {
                        logger.error( "  ### DISCARD " + uow + "   ### MODULE: " + qi4jModule );
                        uow.discard();
                        e.printStackTrace();
                    }
                }
                logger.debug( "REQUEST end" );
                logger.debug( "------------------------------------" );
View Full Code Here

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

}
View Full Code Here

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

}
View Full Code Here

    @After
    public void concludeTest()
    {
        UnitOfWork uow = module.currentUnitOfWork();
        if( uow != null && uow.isOpen() )
            uow.discard();
        if( module != null && module.isUnitOfWorkActive() )
        {
            while( module.isUnitOfWorkActive() )
            {
                uow = module.currentUnitOfWork();
View Full Code Here

            {
                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().name() );
                }
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.