I am sorry,I can not find the @CommitAfter annotation in the
tapestry-hibernate and tapestry-annotation,where can I find it.

By the way,I am using the spring to manage the transaction.

Later I try to add the @Persist to the property like this:

@Persist
private TblCustomerInfo customer;

and I found it have the correct id in the onSuccess when form is submit,But
another problem is when I add new customer,all property has the last
record's value.

I am so puzzled!

-----邮件原件-----
发件人: Sven Homburg [mailto:[EMAIL PROTECTED] 
发送时间: 2008年6月16日 17:11
收件人: Tapestry users
主题: Re: Save error

attach the @CommitAfter annotation to method like this:

@CommitAfter
Object onSuccess()
{
      customerManager.saveCustomer(customer);
      return Customers.class;
}


2008/6/16 滕训华 <[EMAIL PROTECTED]>:

> In my edit tml page there are two methods:
>
>         void onActivate(long customerId){
>
>       customer=customerManager.getCustomerByCustomerId(customerId);
>
>       customer.setCustomerName("afasdfasdfasdf");
>
>       customerManager.saveCustomer(customer);
>
>       System.out.println(customer.getCustomerId());
>
>    }
>
>
>
> Object onSuccess(){
>
>
>
>       customerManager.saveCustomer(customer);
>
>       return Customers.class;
>
>
>
>    }
>
> And my DAO Impl is:
>
>
>
>    public boolean saveCustomer(TblCustomerInfo customerInfo) {
>
>
>
>       getHibernateTemplate().update(customerInfo);
>
>       return true;
>
>    }
>
>
>
> But when the saveCustomer method can be called correctly,and in the
> onSuccess,It will give me an error:
>
> Batch update returned unexpected row count from update [0]; actual row
> count: 0; expected: 1; nested exception is
> org.hibernate.StaleStateException: Batch update returned unexpected row
> count from update [0]; actual row count: 0; expected: 1
>
>
>
> How to slove this?
>
>
>
>


-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com
http://chenillekit.googlecode.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to