public AvailableServiceBindingVO update(AvailableServiceBindingVO availableServiceBindingVO) throws ConstraintException, SystemException
{
Database db = CastorDatabaseService.getDatabase();
ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
AvailableServiceBinding availableServiceBinding = null;
beginTransaction(db);
try
{
//add validation here if needed
availableServiceBinding = getAvailableServiceBindingWithId(availableServiceBindingVO.getAvailableServiceBindingId(), db);
availableServiceBinding.setValueObject(availableServiceBindingVO);
//If any of the validations or setMethods reported an error, we throw them up now before create.
ceb.throwIfNotEmpty();
commitTransaction(db);
}
catch(ConstraintException ce)
{
logger.warn("An error occurred so we should not complete the transaction:" + ce, ce);
rollbackTransaction(db);
throw ce;
}
catch(Exception e)
{
logger.error("An error occurred so we should not complete the transaction:" + e, e);
rollbackTransaction(db);
throw new SystemException(e.getMessage());
}
return availableServiceBinding.getValueObject();
}