Hi Jose, did u remember configure the HibernateTransactionAdviser as described at the bottom of: http://tapestry.apache.org/tapestry5/tapestry-hibernate/userguide.html ?
On Tue, Jul 21, 2009 at 9:13 PM, jose luis sanchez<joseluis.sanc...@m-centric.com> wrote: > Hello all. > > I'm experiencing weird problems with the @CommitAfter tag ... > > Have a hibernate schema, a configuration, and everything ok ( it runs , > checked ), now, the only WAY of getting a data to be persisted into database > is using a transaction, like this > > @OnEvent(component="addCustomer",value="success") > Object onSuccess() { > Customer customer = (Customer) theSession.get(Customer.class, > theSubscription.getId()); > if (customer != null) { > Transaction tx = theSession.beginTransaction(); > theSession.update(customer); > tx.commit(); > } > return null; > } > > > Previously, the following did work, but it's not working now .. it just says > ok, it returns a generated Id , ( as seen in logs ) , but does not persist > the info in the table. > @OnEvent(component="addCustomer",value="success") > @CommitAfter > Object onSuccess() { > Customer customer = (Customer) theSession.get(Customer.class, > theSubscription.getId()); > if (customer != null) { > theSession.update(customer); > } > return null; > } > > > The bean is a java bean ( no Tapestry annotation at all, just the hbm.xml > file , unchanged ) > Any help ? > > > My relevant information from hibernate.cfg > May the transaction factory have anything to do with the problem ? > > <!-- Session configurations --> > <property > name="hibernate.current_session_context_class">thread</property> > <property > name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org