• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem on Resin CMP  RSS feed

Frank Hung
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I encounter some problems while using resin CMP.
I find that when I get a object and update the value of attribute, resin don't really update it, instead it produce a new record
This violate the primary key constraint of my database so error occurs:
Exception while try to update invoice: com.caucho.ejb.EJBExceptionWrapper: com.caucho.transaction.RollbackExceptionWrapper: com.caucho.ejb.EJBExceptionWrapper: com.sybase.jdbc2.jdbc.SybSQLException: Attempt to insert duplicate key row in object 'invoice_items' with unique index 'invoice_it_14011080821'

My method of update data is simple, it is just the following codes:
myInvoiceItem = invoiceItemHome.findByJobNumberAndTarget(invoice_jobNo, invoice_target);

InvoiceItem findByJobNumberAndTarget(String job_number, String target)
throws FinderException;

SELECT o FROM invoiceItems o
AND UPPER(o.invoiceTarget) LIKE UPPER(?2)

I really don't know what is the problem. Can anyone help me?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!