protected void initReladomo(String runtimeConfigXML) throws Exception { MithraManager mithraManager = MithraManagerProvider.getMithraManager(); mithraManager.setTransactionTimeout(60 * 1000); InputStream stream = loadReladomoXMLFromClasspath(runtimeConfigXML); MithraManagerProvider.getMithraManager().readConfiguration(stream); stream.close(); }
protected void initReladomo(String runtimeConfigXML) throws Exception { MithraManager mithraManager = MithraManagerProvider.getMithraManager(); mithraManager.setTransactionTimeout(60 * 1000); loadReladomoXML(runtimeConfigXML); }
protected void loadReladomoXML(String fileName) throws Exception { InputStream stream = BitemporalBankServer.class.getClassLoader().getResourceAsStream(fileName); if (stream == null) { throw new Exception("Failed to locate " + fileName + " in classpath"); } MithraManagerProvider.getMithraManager().readConfiguration(stream); stream.close(); }
@PUT @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON) public Response updateCustomer(@PathParam("id") int customerId, Serialized<Customer> serialized) { Customer customerPojo = serialized.getWrapped(); MithraManager.getInstance().executeTransactionalCommand((tx) -> { //locate the customer Customer customer = CustomerFinder.findOne(CustomerFinder.customerId().eq(customerId)); //update names customer.setFirstName(customerPojo.getFirstName()); customer.setLastName(customerPojo.getLastName()); //delete existing accounts and replace with new accounts customer.getAccounts().deleteAll(); customer.getAccounts().addAll(customerPojo.getAccounts()); return null; }); return Response.ok().build(); }
private void initReladomo() throws Exception { MithraManager mithraManager = MithraManagerProvider.getMithraManager(); mithraManager.setTransactionTimeout(60 * 1000); loadReladomoXML("BitemporalBankRuntimeConfiguration.xml"); }
private void loadReladomoXML(String fileName) throws Exception { InputStream stream = BitemporalBankApp.class.getClassLoader().getResourceAsStream(fileName); if (stream == null) { throw new Exception("Failed to locate " + fileName + " in classpath"); } MithraManagerProvider.getMithraManager().readConfiguration(stream); stream.close(); }
private void initReladomo() throws Exception { MithraManager mithraManager = MithraManagerProvider.getMithraManager(); mithraManager.setTransactionTimeout(60 * 1000); InputStream stream = loadReladomoXMLFromClasspath("SimpleBankRuntimeConfiguration.xml"); MithraManagerProvider.getMithraManager().readConfiguration(stream); stream.close(); }