{
System.out.println("Invalid float number, abort operation...");
return;
}
Current current = null;
try
{
current = OTSManager.get_current();
System.out.println("Beginning a User transaction to Transfer money");
current.begin();
try
{
Account supplier = _bank.get_account(name_supplier);
Account consumer = _bank.get_account(name_consumer);
supplier.debit(current.get_control(), famount);
consumer.credit(current.get_control(), famount);
}
catch (NotExistingAccount nea)
{
System.out.println("Account not Found");
current.rollback_only();
}
current.commit(false);
}
catch (Exception e)
{
System.err.println("ERROR - " + e);
}