/** * Search the IntAct database and retreive a BioSource having the given taxid and no CvCellType or CvTissue. * * @param taxid a non null taxid. * @return a BioSource or null if none is found. */ private BioSource searchIntactByTaxid(String taxid) throws BioSourceServiceException { log.debug("Searching in the database for BioSource(" + taxid + ")"); DataContext dataContext = IntactContext.getCurrentInstance().getDataContext(); TransactionStatus transactionStatus = dataContext.beginTransaction(); BioSourceDao bsDao = dataContext.getDaoFactory().getBioSourceDao(); BioSource biosource = bsDao.getByTaxonIdUnique(taxid); try { dataContext.commitTransaction(transactionStatus); } catch (IntactTransactionException e) { throw new BioSourceServiceException("Problem committing", e); } if (log.isDebugEnabled()) { if (biosource == null) { log.debug("Could not find Biosource having taxid: " + taxid); } else { log.debug("Found 1 biosource: " + biosource.getShortLabel() + " [" + biosource.getAc() + "]"); } } return biosource; }