This content has been marked as final.
Show 2 replies
-
1. Re: Transaction.instance().setRollbackOnly() or Transaction.instance().rollback()cause detatched entity
thejavafreak Sep 7, 2008 3:03 PM (in response to alin.heyoulin.qq.com)Did you close or end your conversation explicitly? Check your code.
-
2. Re: Transaction.instance().setRollbackOnly() or Transaction.instance().rollback()cause detatched entity
alin.heyoulin.qq.com Sep 7, 2008 5:52 PM (in response to alin.heyoulin.qq.com)No. If remove Transaction.instance().setRollbackOnly() it work fine. Otherwise must change @Factory public void getFibres() { pageSize=pageSize==null?10:pageSize; String sql="from WsFibre i where lower(i.fibreNo) like :search " + "or lower(i.fibreType) like :search or lower(i.receiveNo) like :search " + "or lower(i.location) like :search or lower(i.selBatch) like :search " + "or lower(i.selBatch) like :search or lower(i.inBatch) like :search " + "or lower(i.outBatch) like :search " ; fibres= entityManager.createQuery(sql) .setParameter("search", getSearchPattern()).getResultList(); } to @Factory public void getFibres() { pageSize=pageSize==null?10:pageSize; String sql="from WsFibre i join fetch i.item where lower(i.fibreNo) like :search " + "or lower(i.fibreType) like :search or lower(i.receiveNo) like :search " + "or lower(i.location) like :search or lower(i.selBatch) like :search " + "or lower(i.selBatch) like :search or lower(i.inBatch) like :search " + "or lower(i.outBatch) like :search " ; fibres= entityManager.createQuery(sql) .setParameter("search", getSearchPattern()).getResultList(); } add join fetch i.item