Manuel, great that it worked out.
Kind regards, Jeroen Reijn -----Original Message----- From: Manuel Mata [mailto:[EMAIL PROTECTED] Posted At: Wednesday, February 14, 2007 5:20 PM Posted To: Cocoon User List Conversation: Get Hibernate Session inside an Action ? Subject: Re: Get Hibernate Session inside an Action ? > I guess you are refering to the HibernateTutorial > [1] on the wiki? Yes it was that one. > Looking at the > AbstractDatabaseAction and the DatabaseAddAction it > seems they are doing > sort of the same as described on the Hibernate wiki > page, except not > with hibernate indeed. It has been easy. I saw that database actions extends other Actions than AbstractAction so looking the hierarchy I think that the most appropiate for me was the ConfigurableServiceableAction. Making my action extends that one, I had access to the ServiceManager so i can get the PersistenceFactory and use like it like this: PersistenceFactory pf = (PersistenceFactory) manager.lookup(PersistenceFactory.ROLE); Session hs = pf.createSession(); Collection c = hs.createCriteria(MyClass.class).list(); hs.close(); And it works. Thx. ______________________________________________ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
