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