public static void main(String[] args) 
	{
		EntityManagerFactory emf = null;
		
		try
		{
			emf = Persistence.createEntityManagerFactory(UNIT_NAME);
			EntityManager em = emf.createEntityManager();
			Context rootContext = createRootContext(em);
		
			WorkerService workerService = rootContext.lookupService("WorkerService", WorkerService.class);
			
			ContractorWorker contractor = workerService.createContractorWorker("Sam Stone", new Date(), 25000, 365);
			FullTimeWorker fullTimeWorker = workerService.createFullTimeWorker("Will Rock", new Date(), 100, 10000, 30000);
			PartTimeWorker partTimeWorker = workerService.createPartTimeWorker("Duke Nukem", new Date(), 365, 10000);
			
			System.out.println("Before clear");
			System.out.println("Contractor: " + contractor);
			System.out.println("Full time worker: " + fullTimeWorker);
			System.out.println("Part time worker: " + partTimeWorker);
			
			em.clear();
			contractor = (ContractorWorker) workerService.findWorker(contractor.getId());
			fullTimeWorker = (FullTimeWorker) workerService.findWorker(fullTimeWorker.getId());
			partTimeWorker = (PartTimeWorker) workerService.findWorker(partTimeWorker.getId());
			
			System.out.println("After clear");
			System.out.println("Contractor: " + contractor);
			System.out.println("Full time worker: " + fullTimeWorker);
			System.out.println("Part time worker: " + partTimeWorker);
		}
		finally
		{
			if (emf != null)
			{
				emf.close();
			}
		}
	}