If you are using spring and are able to use annotations. There is a good article on the link provided which shows how to use annotations to wrap a method in a transaction.
http://springinpractice.com/2008/03/18/annotation-based-transactions-in-spring/
using spring and hibernate together would make your code look cleaner and would look something like what is below.
@Override
@Transactional
public void addCompany(Company newCompany) {
Objects.requireNonNull(newCompany, "newCompany is null.");
Session session = gileadHibernateUtil.getCurrentSession();
session.persist(newCompany);
//session.close(); this line would also not be needed because the session would close automatically when the transaction is complete.
}