When you @Inject the session, you get a global proxy to the real per-thread Session, which is created on demand. Using HSF.getSession() you get the rea per-threadl Hibernate session. I think the Envers code is written in such a way that it requires the real Session.
On Tue, Jul 14, 2009 at 8:48 AM, newtonik<newto...@gmail.com> wrote: > > > newtonik wrote: >> >> Hey, >> I am trying to do auditing/versioning using the Hibernate >> http://www.jboss.org/files/envers/docs/index.html Envers module. I look >> around, didn't really see much doc on versioning by tapestry users. >> However, I got it work, as in, It automatically saves new revisions if I >> ask it to. However, my issue is trying to query the revisions. It is >> supposed to be simple reading the docs, ideally all i have to do something >> like this. >> >> AuditReader reader = AuditReaderFactory.get(entityManager); >> Person oldPerson = reader.find(Person.class, personId, revision) >> >> Tapestry doesn't use entitymanager, and luckily AuditReaderFactory can be >> supplied a org.hibernate.session. >> AuditReader reader = AuditReaderFactory.get(session); >> >> This hasn't worked for me, every session I give it, it's says the session >> isn't running, the actual error is, >> >> getListeners is not valid without active transaction >> >> I have injected a session, and even tried session.beginTransaction() but >> still get that error. Please help, if you've had a similar error. >> >> >> > > > I get the session correctly, so far so good using HibernateSessionFactory's > getSession, I am not sure what the difference is but it works for now. Hope > it helps someone, I got the tip from > http://www.nabble.com/Re%3A-tapestry-hibernate-conflicts-hibernate-search-p15553536.html > > -- > View this message in context: > http://www.nabble.com/Just-trying-to-get-an-Active-Transaction-tp24479192p24482291.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org