Transaction.begin();
SideEffectLog dbMed = factory.create(side.getSideId());
factory.copyInto(side,dbMed);
Transaction.commit();
}catch(DuplicateKeyException e){
throw new DAOException("A log medication belongs to " + side.getOwner() + "has already existed.");
}catch(RollbackException e){
throw new DAOException(e);
}finally{
if(Transaction.isActive()) Transaction.rollback();
}
}