public void commit() throws DaoException {
// Make sure the transaction has not been committed
if (commmitted) {
throw new DaoException("Transaction already committed");
}
// Now try to commit the transaction
try {
// Check for UnitOfWork
if (unitOfWork != null) {
// UnitOfWork was not lazily loaded
unitOfWork.commit();
unitOfWork.release();
session.release();
}
} catch (TopLinkException e) {
throw new DaoException("Error committing transaction", e);
}
commmitted = true;
}